|
|
std::chrono::system_clock::time_point | Now () noexcept |
| | std::chrono::system_clock::now() that could be mocked
|
| |
|
std::chrono::system_clock::time_point | Epoch () noexcept |
| | Returns std::chrono::system_clock::time_point from the start of the epoch.
|
| |
| std::chrono::steady_clock::time_point | SteadyNow () noexcept |
| | std::chrono::steady_clock::now() that could be mocked
|
| |
|
bool | IsTimeBetween (int hour, int min, int hour_from, int min_from, int hour_to, int min_to, bool include_time_to=false) noexcept |
| | Returns true if the time is in range; works over midnight too.
|
| |
| std::string | Timestring (std::time_t timestamp, const std::string &timezone=kDefaultTimezone, const std::string &format=kDefaultFormat) |
| | Returns time in a string of specified format.
|
| |
|
std::string | LocalTimezoneTimestring (std::time_t timestamp, const std::string &format=kDefaultFormat) |
| | Returns time in a string of specified format.
|
| |
| std::string | Timestring (std::chrono::system_clock::time_point tp, const std::string &timezone=kDefaultTimezone, const std::string &format=kDefaultFormat) |
| | Returns time in a string of specified format.
|
| |
|
std::string | LocalTimezoneTimestring (std::chrono::system_clock::time_point tp, const std::string &format=kDefaultFormat) |
| | Returns time in a string of specified format.
|
| |
| std::chrono::system_clock::time_point | Stringtime (const std::string ×tring, const std::string &timezone=kDefaultTimezone, const std::string &format=kDefaultFormat) |
| | Extracts time point from a string of a specified format.
|
| |
| std::chrono::system_clock::time_point | LocalTimezoneStringtime (const std::string ×tring, const std::string &format=kDefaultFormat) |
| | Extracts time point from a string of a specified format.
|
| |
| std::chrono::system_clock::time_point | GuessStringtime (const std::string ×tamp, const std::string &timezone) |
| | Extracts time point from a string, guessing the format.
|
| |
| std::chrono::system_clock::time_point | GuessLocalTimezoneStringtime (const std::string ×tamp) |
| | Extracts time point from a string, guessing the format.
|
| |
|
std::time_t | Timestamp (std::chrono::system_clock::time_point tp) noexcept |
| | Converts time point to std::time_t.
|
| |
|
std::time_t | Timestamp () noexcept |
| | Returned current time as std::time_t; could be mocked.
|
| |
| std::uint32_t | ParseDayTime (const std::string &str) |
| | Parse day time in hh:mm[:ss] format.
|
| |
| cctz::civil_second | Localize (const std::chrono::system_clock::time_point &tp, const std::string &timezone) |
| | Converts absolute time in std::chrono::system_clock::time_point to a civil time of a particular timezone.
|
| |
|
cctz::civil_second | LocalTimezoneLocalize (const std::chrono::system_clock::time_point &tp) |
| | Converts absolute time in std::chrono::system_clock::time_point to a civil time of a local timezone.
|
| |
| std::time_t | Unlocalize (const cctz::civil_second &local_tp, const std::string &timezone) |
| | Converts a civil time in a specified timezone into an absolute time.
|
| |
|
std::time_t | LocalTimezoneUnlocalize (const cctz::civil_second &local_tp) |
| | Converts a civil time in a local timezone into an absolute time.
|
| |
| std::string | TimestampToString (std::time_t timestamp) |
| | Returns string with time in ISO8601 format "YYYY-MM-DDTHH:MM:SS+0000".
|
| |
| int64_t | TimePointToTicks (const std::chrono::system_clock::time_point &tp) noexcept |
| | Convert time_point to DotNet ticks.
|
| |
|
std::chrono::system_clock::time_point | TicksToTimePoint (int64_t ticks) noexcept |
| | Convert DotNet ticks to a time point.
|
| |
| template<class Duration , class Clock > |
| double | CalcTimeDiff (const std::chrono::time_point< Clock > &a, const std::chrono::time_point< Clock > &b) |
| | Compute (a - b) with a specified duration.
|
| |
|
Date | DateFromRFC3339String (const std::string &date_string) |
| | Validates date_string and constructs date from YYYY-MM-DD string and.
|
| |
|
std::string | ToString (Date date) |
| | Outputs date as a YYYY-MM-DD string.
|
| |
| template<typename Value > |
| std::enable_if_t< formats::common::kIsFormatValue< Value >, Date > | Parse (const Value &value, formats::parse::To< Date >) |
| |
| template<typename Value > |
| std::enable_if_t< formats::common::kIsFormatValue< Value >, Value > | Serialize (Date date, formats::serialize::To< Value >) |
| |
| template<typename StringBuilder > |
| void | WriteToStream (Date value, StringBuilder &sw) |
| |
| template<typename LogHelper = ::logging::LogHelper> |
| ::logging::LogHelper & | operator<< (::logging::LogHelper &lh, const Date &date) |
| |
|
std::ostream & | operator<< (std::ostream &os, Date date) |
| |
|
std::chrono::system_clock::time_point | FromRfc3339StringSaturating (const std::string ×tring) |
| | Converts strings like "2012-12-12T00:00:00" to std::chrono::system_clock::time_point in UTC timezone and saturates on overflow.
|
| |
|
std::chrono::system_clock::time_point | FromStringSaturating (const std::string ×tring, const std::string &format) |
| | Converts strings of the specified format starting with "%Y" to std::chrono::system_clock::time_point in UTC timezone and saturates on overflow.
|
| |
|
std::chrono::system_clock::time_point | MockNow () noexcept |
| |
|
std::chrono::steady_clock::time_point | MockSteadyNow () noexcept |
| |
|
void | MockNowSet (std::chrono::system_clock::time_point new_mocked_now) |
| |
|
void | MockSleep (std::chrono::seconds duration) |
| |
|
void | MockSleep (std::chrono::milliseconds duration) |
| |
|
void | MockNowUnset () |
| |
|
bool | IsMockNow () |
| |
|
| template<typename LDuration , typename RDuration > |
| auto | operator- (TimeOfDay< LDuration > lhs, TimeOfDay< RDuration > rhs) |
| |
| template<typename Duration , typename Rep , typename Period > |
| TimeOfDay< Duration > | operator+ (TimeOfDay< Duration > lhs, std::chrono::duration< Rep, Period > rhs) |
| |
| template<typename Duration , typename Rep , typename Period > |
| TimeOfDay< Duration > | operator- (TimeOfDay< Duration > lhs, std::chrono::duration< Rep, Period > rhs) |
| |
| template<typename Duration > |
| logging::LogHelper & | operator<< (logging::LogHelper &lh, TimeOfDay< Duration > value) |
| |