userver: storages::mysql::DateTime Class Reference
Loading...
Searching...
No Matches
storages::mysql::DateTime Class Referencefinal

#include </data/code/service_template/third_party/userver/mysql/include/userver/storages/mysql/dates.hpp>

Detailed Description

a class that represents MySQL DATETIME type.

Definition at line 46 of file dates.hpp.

Public Member Functions

 DateTime ()
 constructs a DATETIME with DATE/hour/minute/second/microsecond being zero.
 
 DateTime (Date date, std::uint32_t hour, std::uint32_t minute, std::uint32_t second, std::uint64_t microsecond)
 constructs a DATETIME from provided DATE, hour, minute, second and microsecond.
 
 DateTime (std::uint32_t year, std::uint32_t month, std::uint32_t day, std::uint32_t hour, std::uint32_t minute, std::uint32_t second, std::uint64_t microsecond)
 constructs a DATETIME from provided year, month, day, hour, minute, second and microsecond.
 
 DateTime (std::chrono::system_clock::time_point tp)
 constructs a DATETIME from provided timepoint.
 
std::chrono::system_clock::time_point ToTimePoint () const
 converts the DATETIME to timepoint in UTC time zone. throws if stored datetime is out of timepoint range.
 
const DateGetDate () const noexcept
 Returns the date part of the datetime.
 
std::uint32_t GetHour () const noexcept
 Returns the hour part of the datetime.
 
std::uint32_t GetMinute () const noexcept
 Returns the minute part of the datetime.
 
std::uint32_t GetSecond () const noexcept
 Returns the second part of the datetime.
 
std::uint64_t GetMicrosecond () const noexcept
 Returns the microsecond part of the datetime.
 
bool operator== (const DateTime &other) const noexcept
 

The documentation for this class was generated from the following file: