AceTime
0.1
Date and time classes for Arduino that supports the TZ DAtabase, and a system clock synchronized from an NTP server or an RTC chip.
|
An implementation of ZoneSpecifier that works for all zones defined by the TZ Database (with some zones suffering a slight loss of accurancy described below). More...
#include <ExtendedZoneSpecifier.h>
Public Member Functions | |
ExtendedZoneSpecifier (const extended::ZoneInfo *zoneInfo) | |
Constructor. More... | |
const extended::ZoneInfo * | getZoneInfo () const |
Return the underlying ZoneInfo. More... | |
TimeOffset | getUtcOffset (acetime_t epochSeconds) const override |
Return the total UTC offset at epochSeconds, including DST offset. More... | |
TimeOffset | getDeltaOffset (acetime_t epochSeconds) const override |
Return the DST delta offset at epochSeconds. More... | |
const char * | getAbbrev (acetime_t epochSeconds) const override |
Return the time zone abbreviation at epochSeconds. More... | |
TimeOffset | getUtcOffsetForDateTime (const LocalDateTime &ldt) const override |
Return the UTC offset matching the given the date/time components. More... | |
void | printTo (Print &printer) const override |
Print a human-readable identifier. More... | |
void | log () const |
Used only for debugging. More... | |
void | resetTransitionHighWater () |
Reset the TransitionStorage high water mark. More... | |
uint8_t | getTransitionHighWater () const |
Get the TransitionStorage high water mark. More... | |
![]() | |
uint8_t | getType () const |
Return the kTypeXxx of the current instance. More... | |
Additional Inherited Members | |
![]() | |
static const uint8_t | kTypeManual = 1 |
Indicate ManualZoneSpecifier. More... | |
static const uint8_t | kTypeBasic = 2 |
Indicate BasicZoneSpecifier. More... | |
static const uint8_t | kTypeExtended = 3 |
Indicate ExtendedZoneSpecifier. More... | |
![]() | |
ZoneSpecifier (const ZoneSpecifier &)=default | |
ZoneSpecifier & | operator= (const ZoneSpecifier &)=default |
ZoneSpecifier (uint8_t type) | |
Constructor. More... | |
![]() | |
uint8_t | mType |
An implementation of ZoneSpecifier that works for all zones defined by the TZ Database (with some zones suffering a slight loss of accurancy described below).
The supported zones are defined in the zonedbx/zone_infos.h header file. The constructor expects a pointer to one of the ZoneInfo structures declared in the zonedbx/zone_infos.h file. The zone_specifier.py file is a Python implementation of this class.
Just like BasicZoneSpecifier, UTC offsets are stored as a single signed byte in units of 15-minute increments to save memory. Fortunately, all current (year 2019) time zones have DST offsets at 15-minute boundaries. But in addition to the DST offset, this class uses a single signed byte to store the time at which a timezone changes the DST offset.
There are current 5 timezones whose DST transition times are at 00:01 (i.e. 1 minute after midnight). Those transition times are truncated down by tzcompiler.py to the nearest 15-minutes, in other words to 00:00. Those zones are:
Not thread-safe.
Definition at line 631 of file ExtendedZoneSpecifier.h.
|
inlineexplicit |
Constructor.
zoneInfo | pointer to a ZoneInfo. Must not be nullptr. |
Definition at line 637 of file ExtendedZoneSpecifier.h.
|
inlineoverridevirtual |
Return the time zone abbreviation at epochSeconds.
This is an experimental method that has not been tested thoroughly. Use with caution.
Implements ace_time::ZoneSpecifier.
Definition at line 661 of file ExtendedZoneSpecifier.h.
|
inlineoverridevirtual |
Return the DST delta offset at epochSeconds.
This is an experimental method that has not been tested thoroughly. Use with caution.
Implements ace_time::ZoneSpecifier.
Definition at line 654 of file ExtendedZoneSpecifier.h.
|
inline |
Get the TransitionStorage high water mark.
For debugging.
Definition at line 701 of file ExtendedZoneSpecifier.h.
|
inlineoverridevirtual |
Return the total UTC offset at epochSeconds, including DST offset.
Implements ace_time::ZoneSpecifier.
Definition at line 644 of file ExtendedZoneSpecifier.h.
|
inlineoverridevirtual |
Return the UTC offset matching the given the date/time components.
Implements ace_time::ZoneSpecifier.
Definition at line 668 of file ExtendedZoneSpecifier.h.
|
inline |
Return the underlying ZoneInfo.
Definition at line 642 of file ExtendedZoneSpecifier.h.
|
inline |
Used only for debugging.
Definition at line 683 of file ExtendedZoneSpecifier.h.
|
overridevirtual |
Print a human-readable identifier.
Implements ace_time::ZoneSpecifier.
Definition at line 18 of file ExtendedZoneSpecifier.cpp.
|
inline |
Reset the TransitionStorage high water mark.
For debugging.
Definition at line 696 of file ExtendedZoneSpecifier.h.