Date and time functions
Collaboration diagram for Date and time functions:
Modules | |
| Network Time Protocol client | |
| Provides NTP client. | |
| Real Time Clock | |
| Access to the real time clock. | |
| System clock functions | |
| Provides system clock functions. | |
| Time and Delay | |
| Provides time and delay functions. | |
Classes | |
| class | DateTime |
| Date and time class. More... | |
Macros | |
| #define | SECS_PER_MIN 60 |
| #define | SECS_PER_HOUR 3600 |
| #define | SECS_PER_DAY (SECS_PER_HOUR * 24) |
| #define | MINS_PER_HOUR 60 |
| #define | DAYS_PER_WEEK 7 |
| #define | SECS_PER_WEEK (SECS_PER_DAY * DAYS_PER_WEEK) |
| #define | SECS_PER_YEAR (SECS_PER_WEEK * 52) |
| #define | SECS_YR_2000 946681200 |
Enumerations | |
| enum | dtDays_t { dtSunday , dtMonday , dtTuesday , dtWednesday , dtThursday , dtFriday , dtSaturday } |
| Days of week. More... | |
| enum | dtMonth_t { dtJanuary , dtFebruary , dtMarch , dtApril , dtMay , dtJune , dtJuly , dtAugust , dtSeptember , dtOctober , dtNovember , dtDecember } |
| Months. More... | |
Functions | |
| constexpr uint8_t | numberOfSeconds (time_t time) |
| constexpr uint8_t | numberOfMinutes (time_t time) |
| constexpr uint8_t | numberOfHours (time_t time) |
| constexpr dtDays_t | dayOfWeek (time_t time) |
| constexpr uint8_t | elapsedDays (time_t time) |
| constexpr unsigned | elapsedSecsToday (time_t time) |
| constexpr time_t | previousMidnight (time_t time) |
| constexpr time_t | nextMidnight (time_t time) |
| constexpr unsigned | elapsedSecsThisWeek (time_t time) |
Detailed Description
Macro Definition Documentation
◆ DAYS_PER_WEEK
| #define DAYS_PER_WEEK 7 |
◆ MINS_PER_HOUR
| #define MINS_PER_HOUR 60 |
◆ SECS_PER_DAY
| #define SECS_PER_DAY (SECS_PER_HOUR * 24) |
◆ SECS_PER_HOUR
| #define SECS_PER_HOUR 3600 |
◆ SECS_PER_MIN
| #define SECS_PER_MIN 60 |
◆ SECS_PER_WEEK
| #define SECS_PER_WEEK (SECS_PER_DAY * DAYS_PER_WEEK) |
◆ SECS_PER_YEAR
| #define SECS_PER_YEAR (SECS_PER_WEEK * 52) |
◆ SECS_YR_2000
| #define SECS_YR_2000 946681200 |
Enumeration Type Documentation
◆ dtDays_t
| enum dtDays_t |
◆ dtMonth_t
| enum dtMonth_t |
Function Documentation
◆ dayOfWeek()
|
inlineconstexpr |
Get day of week from given Unix time
◆ elapsedDays()
|
inlineconstexpr |
Get elapsed days since 1970-01-01 from given Unix time
◆ elapsedSecsThisWeek()
|
inlineconstexpr |
Get quantity of seconds since midnight at start of previous Sunday from given Unix time
◆ elapsedSecsToday()
|
inlineconstexpr |
Get quantity of seconds since midnight from given Unix time
◆ nextMidnight()
|
inlineconstexpr |
Get Unix time of midnight at end of day from given just Unix time
◆ numberOfHours()
|
inlineconstexpr |
Get just hours part of given Unix time
◆ numberOfMinutes()
|
inlineconstexpr |
Get just minutes part of given Unix time
◆ numberOfSeconds()
|
inlineconstexpr |
Get just seconds part of given Unix time
◆ previousMidnight()
|
inlineconstexpr |
Get Unix time of midnight at start of day from given Unix time
1.9.1