AceTime
3.0.0
Date and time classes for Arduino that support timezones from the TZ Database.
|
Utility functions for setting, retrieving, and converting the current epoch. More...
#include <Epoch.h>
Static Public Member Functions | |
static int16_t | currentEpochYear () |
Get the current epoch year. | |
static void | currentEpochYear (int16_t year) |
Set the current epoch year. | |
static int32_t | daysFromInternalEpoch (int16_t year) |
Return number of days to the given {year}-01-01 from the converter epoch of 2000-01-01. | |
static int32_t | daysToCurrentEpochFromInternalEpoch () |
Number of days from the internal epoch (2000-01-01) to the current epoch. More... | |
static int32_t | daysToCurrentEpochFromUnixEpoch () |
Return the number of days from the Unix epoch (1970-01-01T00:00:00) to the current epoch. | |
static int64_t | secondsToCurrentEpochFromUnixEpoch64 () |
Return the number of seconds from the Unix epoch (1970-01-01T00:00:00) to the current epoch. More... | |
static int16_t | epochValidYearLower () |
The smallest year (inclusive) for which calculations involving the 32-bit epoch_seconds and time zone transitions are guaranteed to be valid without underflowing or overflowing. More... | |
static int16_t | epochValidYearUpper () |
The largest year (exclusive) for which calculations involving the 32-bit epoch_seconds and time zone transitions are guaranteed to be valid without underflowing or overflowing. More... | |
Utility functions for setting, retrieving, and converting the current epoch.
Normally, the default epoch is 2050-01-01T00:00:00 UTC. It can be changed by calling the currentEpochYear(year)
function.
|
inlinestatic |
|
inlinestatic |
The smallest year (inclusive) for which calculations involving the 32-bit epoch_seconds
and time zone transitions are guaranteed to be valid without underflowing or overflowing.
Valid years satisfy the condition year >= validYearLower()
. This condition is not enforced by any code within the library. The limit is exposed for informational purposes for downstream applications.
A 32-bit integer has a range of about 136 years, so the half interval is 68 years. But the algorithms to calculate transitions in zone_processing.h
use a 3-year window straddling the current year, so the actual lower limit is probably closer to currentEpochYear() - 66
. To be conservative, this function returns currentEpochYear() - 50
. It may return a smaller value in the future if the internal calculations can be verified to avoid underflow or overflow problems.
|
inlinestatic |
The largest year (exclusive) for which calculations involving the 32-bit epoch_seconds
and time zone transitions are guaranteed to be valid without underflowing or overflowing.
Valid years satisfy the condition year < validYearUpper()
. This condition is not enforced by any code within the library. The limit is exposed for informational purposes for downstream applications.
A 32-bit integer has a range of about 136 years, so the half interval is 68 years. But the algorithms to calculate the transitions in zone_processing.h
use a 3-year window straddling the current year, so actual upper limit is probably close to currentEpochYear() + 66
. To be conservative, this function returns currentEpochYear() + 50
. It may return a larger value in the future if the internal calculations can be verified to avoid underflow or overflow problems.
|
inlinestatic |