|
2 | 2 |
|
3 | 3 | ## Table of Contents |
4 | 4 |
|
| 5 | +* [Migrating to v2.1.0](#MigratingToVersion210) |
| 6 | + * [Unified Links](#UnifiedLinks) |
| 7 | + * [ZonedExtra](#ZonedExtra) |
5 | 8 | * [Migrating to v2.0.0](#MigratingToVersion200) |
6 | 9 | * [High Level](#HighLevel200) |
7 | 10 | * [Details](#Details200) |
|
15 | 18 | * [Migrating the DS3231Clock](#MigratingTheDS3231Clock) |
16 | 19 | * [Migrating to LinkManagers](#MigratingToLinkManagers) |
17 | 20 |
|
| 21 | +<a name="MigratingToVersion210"></a> |
| 22 | +## Migrating to v2.1 |
| 23 | + |
| 24 | +<a name="UnifiedLinks"></a> |
| 25 | +### Unified Links |
| 26 | + |
| 27 | +Over the years, I implemented 4 different versions of the Link entries: |
| 28 | + |
| 29 | +* Ghost Links (`< v1.5`) |
| 30 | +* Fat Links (`>= v1.5`) |
| 31 | +* Thin Links (`>= v1.6`) |
| 32 | +* Symbolic Links (`>= v1.11`) |
| 33 | + |
| 34 | +I had mistakenly assumed that TZDB Link entries were somehow less important |
| 35 | +than the Zone entries. Often Link entries were old spellings of |
| 36 | +zones which were replaced by new zone names (e.g. "Asia/Calcutta" replaced by |
| 37 | +"Asia/Kolkata"), or zones using an older naming convention pre-1993 (e.g. |
| 38 | +"UTC" replaced by "Etc/UTC"). |
| 39 | + |
| 40 | +The code in AceTime reflected my assumption of the second-class status of Link |
| 41 | +entries. Recently however the IANA TZDB project has aggressively merged |
| 42 | +unrelated Zones (in different countries) into a single zone if they all happen |
| 43 | +to have the same DST transition rules since 1970. The duplicate zones become |
| 44 | +Link entries to the "canonical" zone (e.g. "Arctic/Longyearbyen", |
| 45 | +"Europe/Copenhagen", "Europe/Oslo", "Europe/Stockholm", "Atlantic/Jan_Mayen" are |
| 46 | +all links to "Europe/Berlin"). |
| 47 | + |
| 48 | +It is now more clear the Link entries should be considered first-class entries, |
| 49 | +just like Zone entries. The v2.1 release implements this change in semantics. |
| 50 | +All previous implementations of Links are now merged into a single |
| 51 | +implementation which treats Links equal to Zones, and all the usual operations |
| 52 | +on Zones are also valid on Links. |
| 53 | + |
| 54 | +1) The "Thin Link" feature has been removed, along with the Link Manager |
| 55 | + classes. The code was too complex, and did not provide enough value. |
| 56 | + * `LinkManager` |
| 57 | + * `BasicLinkManager` |
| 58 | + * `ExtendedLinkManager`. |
| 59 | +2) The `followLink` parameter on various `TimeZone` and `ZoneProcessor` methods |
| 60 | + has been removed. |
| 61 | +3) The `zonedb` and `zonedbx` databases no longer contain the link registries: |
| 62 | + * `basic::kLinkRegistry` |
| 63 | + * `extended::kLinkRegistry` |
| 64 | +4) The `kZoneRegistry` is still generated for historical reasons. |
| 65 | + * This registry contains the minimum complete dataset of the IANA timezones. |
| 66 | + * Most applications should use `kZoneAndLinkRegistry` which contains the |
| 67 | + Link entries. |
| 68 | + |
| 69 | +Most application code are expected to treat Links and Zones equally. There are |
| 70 | +only 2 methods which apply only to Link time zones: |
| 71 | + |
| 72 | +* `TimeZone::isLink()` |
| 73 | + * Returns true if the current time zone is a Link. |
| 74 | +* `TimeZone::printTargetZoneNameTo()` |
| 75 | + * Prints the name of the target Zone if the current zone is a link. |
| 76 | + * It prints nothing is `isLink()` is false. |
| 77 | + |
| 78 | +<a name="ZonedExtra"></a> |
| 79 | +### ZonedExtra |
| 80 | + |
| 81 | +The `ZonedExtra` class was created to replace 3 ad-hoc query methods on the |
| 82 | +`TimeZone` object: |
| 83 | + |
| 84 | +* Removed: `TimeZone::getUtcOffset()` |
| 85 | +* Removed: `TimeZone::getDeltaOffset()` |
| 86 | +* Removed: `TimeZone::getAbbrev()` |
| 87 | + |
| 88 | +Once the `ZonedExtra` object has been objected for a particular point in time, |
| 89 | +the following methods on `ZonedExtra` are the replacements for the above: |
| 90 | + |
| 91 | +* `ZonedExtra::timeOffset()` |
| 92 | +* `ZonedExtra::dstOffset()` |
| 93 | +* `ZonedExtra::abbrev()` |
| 94 | + |
| 95 | +The `ZonedExtra` object will normally be created through 2 factory methods: |
| 96 | + |
| 97 | +* `ZonedExtra::forEpochSeconds(epochSeconds, tz)` |
| 98 | +* `ZonedExtra::forLocalDateTime(ldt, tz)` |
| 99 | + |
| 100 | +The `ZonedExtra` object provides access to other meta-information about the time |
| 101 | +zone at that particular time. See the [ZonedExtra](USER_GUIDE.md#ZonedExtra) |
| 102 | +section in the `USER_GUIDE.md` for more detailed information about this class. |
| 103 | + |
18 | 104 | <a name="MigratingToVersion200"></a> |
19 | 105 | ## Migrating to v2.0 |
20 | 106 |
|
|
0 commit comments