@@ -18,7 +18,7 @@ valid from the years `[2000,10000)`. By adjusting the `currentEpochYear()`, the
1818library will work across any 100 year interval across the 8000 year range of the
1919TZ database.
2020
21- ** Version** : 2.1.0 (2023-01-29 , TZDB 2022g)
21+ ** Version** : 2.1.1 (2023-02-02 , TZDB 2022g)
2222
2323** Related Documents** :
2424
@@ -1519,6 +1519,10 @@ class ZonedExtra {
15191519 static const uint8_t kTypeOverlap = 3;
15201520
15211521 static ZonedExtra forError();
1522+ static ZonedExtra forComponents(
1523+ int16_t year, uint8_t month, uint8_t day,
1524+ uint8_t hour, uint8_t minute, uint8_t second,
1525+ const TimeZone& tz, uint8_t fold = 0);
15221526 static ZonedExtra forEpochSeconds(
15231527 acetime_t epochSeconds, const TimeZone& tz);
15241528 static ZonedExtra forLocalDateTime(
@@ -1533,13 +1537,17 @@ class ZonedExtra {
15331537 int16_t reqDstOffsetMinutes,
15341538 const char* abbrev);
15351539
1536- bool isError() const {
1537- uint8_t type() const { return mType; }
1540+ bool isError() const;
1541+ uint8_t type() const;
15381542
1543+ TimeOffset timeOffset() const; // stdOffset + dstOffset
15391544 TimeOffset stdOffset() const;
15401545 TimeOffset dstOffset() const;
1546+
1547+ TimeOffset reqTimeOffset() const; // reqStdOffst + reqDstOffset
15411548 TimeOffset reqStdOffset() const;
15421549 TimeOffset reqDstOffset() const;
1550+
15431551 const char* abbrev() const;
15441552};
15451553
@@ -1550,7 +1558,9 @@ The `ZonedExtra` instance is usually created through the 2 static factory
15501558methods on the `ZonedExtra` class:
15511559
15521560* `ZonedExtra::forEpochSeconds(epochSeconds, tz)`
1553- * `ZonedExtra::forLocalDateTime(ldt, tz)`
1561+ * `ZonedExtra::forComponents(int16_t year, uint8_t month, uint8_t day,
1562+ uint8_t hour, uint8_t minute, uint8_t second, const TimeZone& tz,
1563+ uint8_t fold = 0)`
15541564
15551565Often the `ZonedDateTime` will be created first from the epochSeconds, then the
15561566`ZonedExtra` will be created to access additional information about the time zone at that particular epochSeconds (e.g. abbreviation):
@@ -1578,8 +1588,9 @@ The `ZonedExtra::dstOffset()` is the DST offset that pertains to the given
15781588time instant. For example, for ` America/Los_Angeles ` this will return ` 01:00 `
15791589during summer DST, and ` 00:00 ` during normal times.
15801590
1581- Note that the total UTC offset corresponding to ` ZonedDateTime::timeOffset() ` is
1582- equal to ` stdOffset() + dstOffset() ` .
1591+ The ` ZonedExtra::timeOffset() ` is a convenience method that returns the sum of
1592+ ` stdOffset() + dstOffset() ` . This value is identical to the total UTC offset
1593+ returned by ` ZonedDateTime::timeOffset() ` .
15831594
15841595The ` ZonedExtra::abbrev() ` is the short abbreviation that is in effect at the
15851596given time instant. For example, for ` America/Los_Angeles ` , this returns "PST"
@@ -1589,8 +1600,8 @@ the life of the `ZonedExtra` object.
15891600
15901601The ` ZonedExtra::reqStdOffset() ` and ` ZonedExtra::reqDstOffset() ` are relevant
15911602and different from the corresponding ` stdOffset() ` and ` dstOffset() ` only if the
1592- ` type() ` is ` kTypeGap ` . This occurs only if the ` getZonedExtra(LocalDateTime& )`
1593- overloaded version is used. Following the algorithm described in [ Python PEP
1603+ ` type() ` is ` kTypeGap ` . This occurs only if the ` ZonedExtra::forComponents( )`
1604+ factory method is used. Following the algorithm described in [ Python PEP
15941605495] ( https://www.python.org/dev/peps/pep-0495/ ) , the provided localDateTime is
15951606imaginary during a gap so must be mapped to a real local time using the
15961607` LocalDateTime::fold ` parameter. When ` fold=0 ` , the transition line before the
@@ -1788,8 +1799,8 @@ zone name:
17881799```C++
17891800ExtendedZoneProcessorCache<CACHE_SIZE> zoneProcessorCache;
17901801ExtendedZoneManager zoneManager(
1791- zonedbx::kZoneRegistrySize ,
1792- zonedbx::kZoneRegistry ,
1802+ zonedbx::kZoneAndLinkRegistrySize ,
1803+ zonedbx::kZoneAndLinkRegistry ,
17931804 zoneProcessorCache);
17941805
17951806void someFunction() {
@@ -1807,8 +1818,8 @@ could be done more efficiently using the `createForZoneInfo()` like this:
18071818``` C++
18081819ExtendedZoneProcessorCache<CACHE_SIZE> zoneProcessorCache;
18091820ExtendedZoneManager zoneManager (
1810- zonedbx::kZoneRegistrySize ,
1811- zonedbx::kZoneRegistry ,
1821+ zonedbx::kZoneAndLinkRegistrySize ,
1822+ zonedbx::kZoneAndLinkRegistry ,
18121823 zoneProcessorCache);
18131824
18141825void someFunction() {
@@ -1844,8 +1855,8 @@ corresponding to the given `zoneId`:
18441855```C++
18451856ExtendedZoneProcessorCache<CACHE_SIZE> zoneProcessorCache;
18461857ExtendedZoneManager zoneManager(
1847- zonedbx::kZoneRegistrySize ,
1848- zonedbx::kZoneRegistry ,
1858+ zonedbx::kZoneAndLinkRegistrySize ,
1859+ zonedbx::kZoneAndLinkRegistry ,
18491860 zoneProcessorCache);
18501861
18511862void someFunction() {
@@ -2207,8 +2218,8 @@ Here are some examples taken from
22072218```C++
22082219ExtendedZoneProcessorCache<1> zoneProcessorCache;
22092220ExtendedZoneManager extendedZoneManager(
2210- zonedbx::kZoneRegistrySize ,
2211- zonedbx::kZoneRegistry ,
2221+ zonedbx::kZoneAndLinkRegistrySize ,
2222+ zonedbx::kZoneAndLinkRegistry ,
22122223 zoneProcessorCache);
22132224TimeZone tz = extendedZoneManager.createForZoneInfo(
22142225 &zonedbx::kZoneAmerica_Los_Angeles);
@@ -2517,9 +2528,12 @@ canonical entry (e.g. `US/Pacific` which points to `America/Los_Angeles`).
25172528Prior to v2.1, AceTime treated Links slightly differently than Zones, providing
251825294 different implementations over several version. After v2.1, Links are
25192530considered to be identical to Zones, because the TZDB considers both of them to
2520- be first-class citizens. Following this merger, the `kZoneAndLinkRegistry` has
2521- been merged into the `kZoneRegistry` and the 2 registries are identical.
2531+ be first-class citizens. For most 32-bit processors with enough flash memory,
2532+ the `kZoneAndLinkRegistry` should be used. The `kZoneRegistry` containing
2533+ only the Zone entries is maintained mostly for backwards compatibility and
2534+ testing purposes.
25222535
2536+ Most methods on the `TimeZone` class apply to both Zone and Link time zones.
25232537There are 2 methods on the `TimeZone` class which apply only to Links:
25242538
25252539```C++
@@ -2546,10 +2560,10 @@ the time zone `US/Pacific` (which is a Link to `America/Los_Angeles`):
25462560#### Custom Zone Registry
25472561
25482562On small microcontrollers, the default zone registries (`kZoneRegistry` and
2549- `kZoneAndLinkRegistry`, which are now identical ) may be too large. The
2550- `ZoneManager` can be configured with a custom zone registry. It needs to be
2551- given an array of `ZoneInfo` pointers when constructed. For example, here is a
2552- `BasicZoneManager` with only 4 zones from the `zonedb::` data set:
2563+ `kZoneAndLinkRegistry`) may be too large. The `ZoneManager` can be configured
2564+ with a custom zone registry. It needs to be given an array of `ZoneInfo`
2565+ pointers when constructed. For example, here is a `BasicZoneManager` with only 4
2566+ zones from the `zonedb::` data set:
25532567
25542568```C++
25552569#include <AceTime.h>
0 commit comments