xentara-utils v2.0.4
The Xentara Utility Library
|
A time point, decomposed into its components. More...
#include <xentara/utils/chrono/DecomposedTimePoint.hpp>
Public Member Functions | |
constexpr | DecomposedTimePoint () noexcept=default |
Default constructor. | |
DecomposedTimePoint (std::chrono::system_clock::time_point timePoint, const std::optional< std::chrono::minutes > &utcOffset=std::nullopt) noexcept | |
Constructor for a specific time. | |
constexpr auto | year () const noexcept -> int |
Gets the calendar year. | |
constexpr auto | month () const noexcept -> unsigned int |
Gets the calendar month. | |
constexpr auto | day () const noexcept -> unsigned int |
Gets the day of the month. | |
constexpr auto | date () const noexcept -> const DecomposedDate & |
Gets the entire date. | |
constexpr auto | hour () const noexcept -> unsigned int |
Gets the hour within the day. | |
constexpr auto | minute () const noexcept -> unsigned int |
Gets the minute within the hour. | |
constexpr auto | second () const noexcept -> unsigned int |
Gets the second within the minute. | |
constexpr auto | nanosecond () const noexcept -> unsigned int |
Gets the number of nanoseconds after the second. | |
constexpr auto | utcOffsetSign () const noexcept -> int |
Gets direction of the UTC offset. | |
constexpr auto | utcOffsetHours () const noexcept -> unsigned int |
Gets the hours component of the time zone. | |
constexpr auto | utcOffsetMinutes () const noexcept -> unsigned int |
Gets the minutes component of the time zone. | |
A time point, decomposed into its components.
This class uses the so called “proleptic Gregorian calendar”, which is the Gregorian calendar extended to dates before October 15, 1582.
|
constexprdefaultnoexcept |
Default constructor.
This constructor constructs a time point corresponding to 2001-01-01 00:00:00 UTC.
|
noexcept |
Constructor for a specific time.
timePoint | The time point. |
utcOffset | The UTC offset to represent the time in, or std::nullopt to use local time. The UTC offset only influences how the time is represented in the constructed object: timePoint must always be a regular UTC time without any offset. If you pass a time of 1 January 2001, 00:00:00.000 UTC and a UTC offset of +1 hours, the time will decomposed to 2001-01-01 01:00:00 UTC+01:00, for example. |
|
constexprnoexcept |
Gets the entire date.
|
constexprnoexcept |
Gets the day of the month.
|
constexprnoexcept |
Gets the hour within the day.
|
constexprnoexcept |
Gets the minute within the hour.
|
constexprnoexcept |
Gets the calendar month.
|
constexprnoexcept |
Gets the number of nanoseconds after the second.
|
constexprnoexcept |
Gets the second within the minute.
|
constexprnoexcept |
Gets the hours component of the time zone.
|
constexprnoexcept |
Gets the minutes component of the time zone.
|
constexprnoexcept |
Gets direction of the UTC offset.
|
constexprnoexcept |
Gets the calendar year.