AceTime
0.7
Date and time classes for Arduino that support timezones from the TZ Database, and a system clock that can synchronize from an NTP server or an RTC chip.
|
An implementation of ZoneProcessor that supports for all zones defined by the TZ Database. More...
#include <ExtendedZoneProcessor.h>
Public Member Functions | |
ExtendedZoneProcessor (const extended::ZoneInfo *zoneInfo=nullptr) | |
Constructor. More... | |
const void * | getZoneInfo () const override |
Return the underlying ZoneInfo. More... | |
uint32_t | getZoneId () const override |
Return the unique stable zoneId. 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... | |
OffsetDateTime | getOffsetDateTime (const LocalDateTime &ldt) const override |
Return the best estimate of the OffsetDateTime at the given LocalDateTime for the timezone of the current ZoneProcessor. More... | |
void | printTo (Print &printer) const override |
Print a human-readable identifier (e.g. More... | |
void | printShortTo (Print &printer) const override |
Print a short human-readable identifier (e.g. 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 | kTypeBasic = 2 |
Indicate BasicZoneProcessor. More... | |
static const uint8_t | kTypeExtended = 3 |
Indicate ExtendedZoneProcessor. More... | |
![]() | |
ZoneProcessor (const ZoneProcessor &)=delete | |
ZoneProcessor & | operator= (const ZoneProcessor &)=delete |
ZoneProcessor (uint8_t type) | |
Constructor. More... | |
![]() | |
uint8_t | mType |
An implementation of ZoneProcessor that supports for all zones defined by the TZ Database.
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 the initial Python implementation of this class, which got translated into C++.
Currently (as of v0.7), the underlying zoneinfo files (extended::ZoneInfo, etc) store the UTC and DST offsets of a timezone as a single signed byte in 15-minute increments. This is sufficient to accurate describe all time zones from the year 2000 until 2050. The AT and UNTIL transition times are stored using a 1-minute resolution, which correctly handles the 5 timezones whose DST transition times occur at 00:01. Those zones are:
Not thread-safe.
Definition at line 658 of file ExtendedZoneProcessor.h.
|
inlineexplicit |
Constructor.
The ZoneInfo is given only for unit tests.
zoneInfo | pointer to a ZoneInfo. |
Definition at line 664 of file ExtendedZoneProcessor.h.
|
inlineoverridevirtual |
Return the time zone abbreviation at epochSeconds.
This is an experimental method that has not been tested thoroughly. Use with caution. Returns an empty string ("") if an error occurs.
Implements ace_time::ZoneProcessor.
Definition at line 693 of file ExtendedZoneProcessor.h.
|
inlineoverridevirtual |
Return the DST delta offset at epochSeconds.
This is an experimental method that has not been tested thoroughly. Use with caution. Returns TimeOffset::forError() if an error occurs.
Implements ace_time::ZoneProcessor.
Definition at line 686 of file ExtendedZoneProcessor.h.
|
inlineoverridevirtual |
Return the best estimate of the OffsetDateTime at the given LocalDateTime for the timezone of the current ZoneProcessor.
Returns OffsetDateTime::forError() if an error occurs, for example, if the LocalDateTime is outside of the support date range of the underlying ZoneInfo files.
Implements ace_time::ZoneProcessor.
Definition at line 700 of file ExtendedZoneProcessor.h.
|
inline |
Get the TransitionStorage high water mark.
For debugging.
Definition at line 781 of file ExtendedZoneProcessor.h.
|
inlineoverridevirtual |
Return the total UTC offset at epochSeconds, including DST offset.
Returns TimeOffset::forError() if an error occurs.
Implements ace_time::ZoneProcessor.
Definition at line 676 of file ExtendedZoneProcessor.h.
|
inlineoverridevirtual |
Return the unique stable zoneId.
Implements ace_time::ZoneProcessor.
Definition at line 674 of file ExtendedZoneProcessor.h.
|
inlineoverridevirtual |
Return the underlying ZoneInfo.
Implements ace_time::ZoneProcessor.
Definition at line 670 of file ExtendedZoneProcessor.h.
|
inline |
Used only for debugging.
Definition at line 763 of file ExtendedZoneProcessor.h.
|
overridevirtual |
Print a short human-readable identifier (e.g.
"Los_Angeles")
Implements ace_time::ZoneProcessor.
Definition at line 29 of file ExtendedZoneProcessor.cpp.
|
overridevirtual |
Print a human-readable identifier (e.g.
"America/Los_Angeles").
Implements ace_time::ZoneProcessor.
Definition at line 25 of file ExtendedZoneProcessor.cpp.
|
inline |
Reset the TransitionStorage high water mark.
For debugging.
Definition at line 776 of file ExtendedZoneProcessor.h.