|
Ersa Wearable Platform
Embedded smartwatch firmware and application framework
|
#include <calendar_time.h>
Public Member Functions | |
| constexpr | CalendarTime ()=default |
| constexpr | CalendarTime (uint16_t y, uint8_t m, uint8_t d, uint8_t h, uint8_t min, uint8_t s) |
| CalendarTime (uint32_t epoch) | |
| CalendarTime (const char *date, const char *time) | |
| constexpr uint16_t | year () const |
| constexpr uint8_t | month () const |
| constexpr uint8_t | day () const |
| constexpr uint8_t | hour () const |
| constexpr uint8_t | minute () const |
| constexpr uint8_t | second () const |
| constexpr bool | isValid () const |
| uint8_t | dayOfTheWeek () const |
| uint32_t | unixtime () const |
Private Member Functions | |
| int64_t | daysSinceEpoch () const |
| void | fromEpoch (uint32_t epoch) |
| void | fromBuildStrings (const char *date, const char *time) |
Static Private Member Functions | |
| static constexpr bool | leap (uint16_t y) |
| static constexpr uint8_t | daysInMonth (uint16_t y, uint8_t m) |
Private Attributes | |
| uint16_t | year_ {0} |
| uint8_t | month_ {0} |
| uint8_t | day_ {0} |
| uint8_t | hour_ {0} |
| uint8_t | minute_ {0} |
| uint8_t | second_ {0} |
Small Gregorian calendar value used by apps without a third-party date library.
|
constexprdefault |
Construct an invalid zero value.
|
inlineconstexpr |
Construct from calendar fields.
|
inlineexplicit |
Construct from Unix seconds.
Construct from the compiler's __DATE__ and __TIME__ strings.
| uint8_t ersa::common::CalendarTime::dayOfTheWeek | ( | ) | const |
Return Sunday=0 through Saturday=6. Return the weekday using Sunday=0 through Saturday=6.
|
inlinestaticconstexprprivate |
|
private |
|
inlineprivate |
| uint32_t ersa::common::CalendarTime::unixtime | ( | ) | const |
Convert valid calendar fields to Unix seconds; invalid values return zero. Convert a valid calendar value to Unix seconds; invalid values return zero.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |