|
roo_time
API Documentation for roo_time
|
Represents wall time decomposed into date/time in a specific time zone. More...
#include <roo_time.h>
Public Member Functions | |
| DateTime () | |
Constructs DateTime representing current time in UTC. | |
| DateTime (uint16_t year, uint8_t month, uint8_t day, TimeZone tz) | |
Constructs DateTime at midnight of a date in the specified time zone. | |
| DateTime (uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t micros, TimeZone tz) | |
| Constructs date/time in the specified time zone. | |
| DateTime (WallTime wallTime, TimeZone tz) | |
Constructs DateTime for wallTime in time zone tz. | |
| WallTime | wallTime () const |
Returns WallTime corresponding to this DateTime. | |
| TimeZone | timeZone () const |
Returns time zone of this DateTime. | |
| int16_t | year () const |
| Returns four-digit year. | |
| Month | month () const |
| Returns month in [1, 12]. | |
| uint8_t | day () const |
| Returns day of month in valid range. | |
| uint8_t | hour () const |
| Returns hour in [0, 23]. | |
| uint8_t | minute () const |
| Returns minute in [0, 59]. | |
| uint8_t | second () const |
| Returns second in [0, 59]. | |
| uint32_t | micros () const |
| Returns microsecond fraction in [0, 999999]. | |
| DayOfWeek | dayOfWeek () const |
| Returns day of week in this time zone. | |
| uint16_t | dayOfYear () const |
| Returns day of year in [1, 366]. | |
Represents wall time decomposed into date/time in a specific time zone.
Does not account for leap seconds.
Definition at line 735 of file roo_time.h.
|
inline |
Constructs DateTime representing current time in UTC.
Definition at line 738 of file roo_time.h.
| roo_time::DateTime::DateTime | ( | uint16_t | year, |
| uint8_t | month, | ||
| uint8_t | day, | ||
| TimeZone | tz | ||
| ) |
Constructs DateTime at midnight of a date in the specified time zone.
| year | Four-digit year. |
| month | Month in [1, 12]. |
| day | Day in [1, max_day_of_month]. |
Definition at line 120 of file roo_time.cpp.
| roo_time::DateTime::DateTime | ( | uint16_t | year, |
| uint8_t | month, | ||
| uint8_t | day, | ||
| uint8_t | hour, | ||
| uint8_t | minute, | ||
| uint8_t | second, | ||
| uint32_t | micros, | ||
| TimeZone | tz | ||
| ) |
Constructs date/time in the specified time zone.
| year | Four-digit year. |
| month | Month in [1, 12]. |
| day | Day in [1, max_day_of_month]. |
| hour | Hour in [0, 23]. |
| minute | Minute in [0, 59]. |
| second | Second in [0, 59]. |
| micros | Microsecond fraction in [0, 999999]. |
| tz | Time zone to interpret the components in. |
Definition at line 123 of file roo_time.cpp.
References day(), hour(), micros(), roo_time::Micros(), minute(), month(), roo_time::TimeZone::offset(), second(), and year().
Constructs DateTime for wallTime in time zone tz.
Definition at line 140 of file roo_time.cpp.
References roo_time::Duration::inHours(), roo_time::Duration::inMicros(), roo_time::TimeZone::offset(), and roo_time::WallTime::sinceEpoch().
|
inline |
Returns day of month in valid range.
Definition at line 776 of file roo_time.h.
Referenced by DateTime().
|
inline |
Returns day of week in this time zone.
Definition at line 791 of file roo_time.h.
|
inline |
Returns day of year in [1, 366].
Definition at line 794 of file roo_time.h.
|
inline |
|
inline |
Returns microsecond fraction in [0, 999999].
Definition at line 788 of file roo_time.h.
Referenced by DateTime().
|
inline |
|
inline |
|
inline |
|
inline |
Returns time zone of this DateTime.
Definition at line 767 of file roo_time.h.
Referenced by roo_time::operator!=(), and roo_time::operator==().
|
inline |
Returns WallTime corresponding to this DateTime.
Definition at line 764 of file roo_time.h.
Referenced by roo_time::operator!=(), and roo_time::operator==().
|
inline |