22
33See the [ README.md] ( README.md ) for introductory background.
44
5- Version: 0.8. 1 (2019-08-26 , TZ DB version 2019b, beta )
5+ Version: 1. 1 (2020-04-25 , TZ DB version 2020a )
66
77## Installation
88
@@ -68,9 +68,10 @@ usually have more precise dependency information:
6868Various scripts in the ` tools/ ` directory depend on:
6969
7070* [ IANA TZ Database on GitHub] ( https://github.com/eggert/tz )
71- * [ pytz library] ( https://pypi.org/project/pytz/ )
71+ * [ Python pytz library] ( https://pypi.org/project/pytz/ )
72+ * [ Python dateutil library] ( https://pypi.org/project/python-dateutil )
7273* [ Hinnant date library] ( https://github.com/HowardHinnant/date )
73- * Python 3.5 or greater
74+ * Python 3.6 or greater
7475* Java OpenJDK 11
7576
7677If you want to run the unit tests or some of the command line examples using a
@@ -770,7 +771,7 @@ TimeZone <>-------- ZoneProcessor ------- ZoneProcessorCache
770771 .----- +----. .---- +-----.
771772 | | | |
772773 BasicZone ExtendedZone BasicZone ExtendedZone
773- Processor Processor ProcessorCache ZoneProcessor
774+ Processor Processor ProcessorCache ProcessorCache
774775```
775776
776777Here is the class declaration of ` TimeZone ` :
@@ -1620,11 +1621,6 @@ by zoneName or zoneId) into an index into the registry.
16201621The IANA TZ Database is updated continually. As of this writing, the latest
16211622stable version is 2019b. When a new version of the database is released, it is
16221623relatively easy to regenerate the ` zonedb/ ` and ` zonedbx/ ` zoneinfo files.
1623- However, it is likely that I would delay the release of a new version until the
1624- corresponding ` pytz ` package is updated to the latest TZ database version, so
1625- that the validation test suites pass (See Testing section below). Otherwise, I
1626- don't have a way to verify that the AceTime library with the new TZ Database
1627- version is correctly functioning.
16281624
16291625## Mutations
16301626
@@ -2029,6 +2025,11 @@ void loop() {
20292025}
20302026```
20312027
2028+ It has been claimed that the DS1307 and DS3232 RTC chips have exactly same
2029+ interface as DS3231 when accessing the time and date functionality. I don't have
2030+ these chips so I cannot confirm that. Contact @Naguissa
2031+ ( https:// github.com/Naguissa) for more info.
2032+
20322033### System Clock
20332034
20342035The `SystemClock` is a special `Clock` that uses the Arduino built-in `millis()`
@@ -2344,9 +2345,10 @@ timezones.
23442345
23452346My next idea was to validate AceTime against a known, independently created,
23462347timezone library that also supports the TZ Database. Currently, I validate
2347- the AceTime library against 3 other timezone libraries:
2348+ the AceTime library against 4 other timezone libraries:
23482349
23492350* Python [pytz](https://pypi.org/project/pytz/)
2351+ * Python [dateutil](https://pypi.org/project/python-dateutil)
23502352* Java 11 [java.time](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/package-summary.html)
23512353* C++11/14/17 [Hinnant date](https://github.com/HowardHinnant/date)
23522354
@@ -2359,8 +2361,8 @@ found in the future.
23592361The Python pytz library was a natural choice since the `tzcompiler.py` was
23602362already written in Python. I created:
23612363
2362- * [BasicValidationUsingPythonTest ](tests/validation/BasicValidationUsingPythonTest /)
2363- * [ExtendedValidationUsingPythonTest ](tests/validation/ExtendedValidationUsingPythonTest /)
2364+ * [BasicPythonTest ](tests/validation/BasicPythonTest /)
2365+ * [ExtendedPythonTest ](tests/validation/ExtendedPythonTest /)
23642366
23652367The `pytz` library is used to generate various C++ source code
23662368(`validation_data.cpp`, `validation_data.h`, `validation_tests.cpp`) which
@@ -2377,31 +2379,45 @@ executed only on desktop-class Linux or MacOS machines through the use of the
23772379The `pytz` library supports [dates only until
237823802038](https://answers.launchpad.net/pytz/+question/262216). It is also tricky to
23792381match the `pytz` version to the TZ Database version used by AceTime. The
2380- following combinations have been tested:
2382+ following versions of `pytz` have been tested:
2383+
2384+ * pytz 2019.1, containing TZ Datbase 2019a
2385+ * pytz 2019.2, containing TZ Datbase 2019b
2386+ * pytz 2019.3, containing TZ Datbase 2019c
2387+
2388+ ### Python dateutil
2389+
2390+ Validation against the Python dateutil library is similar to pytz. I created:
2391+
2392+ * [BasicDateUtilTest](tests/validation/BasicDateUtilTest/)
2393+ * [ExtendedDateUtilTest](tests/validation/ExtendedDateUtilTest/)
2394+
2395+ Similar to the `pytz` library, the `dateutil` library supports [dates only until
2396+ 2038](https://github.com/dateutil/dateutil/issues/462). The
2397+ following versions of `dateutil` have been tested:
23812398
2382- * TZ Datbase: 2019a; pytz: 2019.1
2383- * TZ Datbase: 2019b; pytz: 2019.2
2399+ * dateutil 2.8.1, containing TZ Datbase 2019c
23842400
23852401### Java java.time
23862402
23872403The Java 11 `java.time` library is not limited to 2038 but supports years
2388- through the [year 1000000000
2404+ through the [year 1,000,000,000
23892405(billion)](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/class-use/Instant.html).
2390- I wrote the [TestDataGenerator.java](tools/java /TestDataGenerator) program to
2391- generate a `validation_data.cpp` file in exactly the same format as the
2392- `tzcompiler.py` program, and produced data points from year 2000 to year 2050,
2393- which is the exact range of years supported by the `zonedb::` and `zonedbx::`
2394- zoneinfo files.
2406+ I wrote the [TestDataGenerator.java](tools/compare_java /TestDataGenerator.java)
2407+ program to generate a `validation_data.cpp` file in exactly the same format as
2408+ the `tzcompiler.py` program, and produced data points from year 2000 to year
2409+ 2050, which is the exact range of years supported by the `zonedb::` and
2410+ `zonedbx::` zoneinfo files.
23952411
23962412The result is 2 validation programs under `tests/validation`:
23972413
2398- * [BasicValidationUsingJavaTest ](tests/validation/BasicValidationUsingJavaTest /)
2399- * [ExtendedValidationUsingJavaTest ](tests/validation/ExtendedValidationUsingJavaTest /)
2414+ * [BasicJavaTest ](tests/validation/BasicJavaTest /)
2415+ * [ExtendedJavaTest ](tests/validation/ExtendedJavaTest /)
24002416
24012417The most difficult part of using Java is figuring out how to install it
24022418and figuring out which of the many variants of the JDK to use. On Ubuntu 18.04,
24032419I used `openjdk 11.0.4 2019-07-16` which seems to use TZ Database 2018g. I have
2404- no recollection how I installed, I think it was something like `$ sudo apt
2420+ no recollection how I installed it , I think it was something like `$ sudo apt
24052421install openjdk-11-jdk:amd64`.
24062422
24072423The underlying timezone database used by the `java.time` package seems to be
@@ -2421,14 +2437,15 @@ powerful, complex and difficult to use. I managed to incorporate it into 2 more
24212437validation tests, and verified that the AceTime library matches the Hinnant date
24222438library for all timezones from 2000 to 2049 (inclusive):
24232439
2424- * [BasicValidationUsingHinnantDateTest ](tests/validation/BasicValidationUsingHinnantDateTest /)
2425- * [ExtendedValidationUsingHinnantDateTest ](tests/validation/ExtendedValidationUsingHinnantDateTest /)
2440+ * [BasicHinnantDateTest ](tests/validation/BasicHinnantDateTest /)
2441+ * [ExtendedHinnantDateTest ](tests/validation/ExtendedHinnantDateTest /)
24262442
2427- I have validated the AceTime library with the following TZ versions against
2428- the Hinnant date library with the same TZ version:
2429-
2430- * TZ Database: 2019a
2431- * TZ Database: 2019b
2443+ I have validated the AceTime library with the Hinnant date library for the
2444+ following TZ Dabase versions:
2445+ * TZ DB version 2019a
2446+ * TZ DB version 2019b
2447+ * TZ DB version 2019c
2448+ * TZ DB version 2020a
24322449
24332450## Benchmarks
24342451
@@ -2630,10 +2647,10 @@ environment because:
26302647 library.
26312648
26322649The Hinnant date libraries were invaluable for writing the
2633- [BasicValidationUsingHinnantDateTest ](tests/validation/BasicValidationUsingHinnantDateTest /)
2650+ [BasicHinnantDateTest ](tests/validation/BasicHinnantDateTest /)
26342651and
2635- [ExtendedValidationUsingHinnantDateTest ](tests/validation/ExtendedValidationUsingHinnantDateTest /)
2636- validation tests (in v0.7) which are the AceTime algorithms to the Hinnant Date
2652+ [ExtendedHinnantDateTest ](tests/validation/ExtendedHinnantDateTest /)
2653+ validation tests which compare the AceTime algorithms to the Hinnant Date
26372654algorithms. For all times zones between the years 2000 until 2050, the AceTime
26382655UTC offsets (`TimeZone::getUtcOffset()`), timezone abbreviations
26392656(`TimeZone::getAbbrev()`), and epochSecond conversion to date components
@@ -2644,8 +2661,8 @@ libraries.
26442661
26452662The [cctz](https://github.com/google/cctz) library from Google is also based on
26462663the `<chrono>` library. I have not looked at this library closely because I
2647- assumed that it would fit inside an Arduino controller. Hopefully I will get
2648- some time to take a closer look in the future.
2664+ assumed that it would *not* fit inside an Arduino controller. Hopefully I will
2665+ get some time to take a closer look in the future.
26492666
26502667## Bugs and Limitations
26512668
@@ -2703,10 +2720,11 @@ some time to take a closer look in the future.
27032720 not load the entire TZ Database due to memory constraints of most Arduino
27042721 boards.
27052722* `TimeZone`
2706- * It might be possible to use a Basic `TimeZone` created using a `zonedb::`
2707- zoneinfo file, and an Extended `TimeZone` using a `zonedbx::` zoneinfo
2708- file. However, this is not a configuration that is expected to be used
2709- often, so it has not been tested well, if at all.
2723+ * It might be possible to use both a Basic `TimeZone` created using a
2724+ `zonedb::` zoneinfo file, and an Extended `TimeZone` using a `zonedbx::`
2725+ zoneinfo file, together in a single program. However, this is not a
2726+ configuration that is expected to be used often, so it has not been tested
2727+ well, if at all.
27102728 * One potential problem is that the equality of two `TimeZone` depends only
27112729 on the `zoneId`, so a Basic `TimeZone` created with a
27122730 `zonedb::kZoneAmerica_Los_Angeles` will be considered equal to an Extended
@@ -2743,8 +2761,11 @@ some time to take a closer look in the future.
27432761 but this is sufficient to support the vast majority of timezones since
27442762 2000.
27452763 * The `zonedb/` files have been filtered to satisfy these constraints.
2746- * Tested again Python [pytz](https://pypi.org/project/pytz/) from
2764+ * Tested against Python [pytz](https://pypi.org/project/pytz/) from
27472765 2000 until 2038 (limited by pytz).
2766+ * Tested against Python
2767+ [dateutil](https://pypi.org/project/python-dateutil/) from
2768+ 2000 until 2038 (limited by dateutil).
27482769 * Tested against Java `java.time` from 2000 to until 2050.
27492770 * Tested against C++11/14/17
27502771 [Hinnant date](https://github.com/HowardHinnant/date) from 2000 until
@@ -2753,12 +2774,15 @@ some time to take a closer look in the future.
27532774 * Has a 1-minute resolution for all time fields.
27542775 * The `zonedbx/` files currently (version 2019b) do not have any timezones
27552776 with 1-minute resolution.
2756- * Tested again Python [pytz](https://pypi.org/project/pytz/) from
2777+ * Tested against Python [pytz](https://pypi.org/project/pytz/) from
27572778 2000 until 2038 (limited by pytz).
2779+ * Tested against Python
2780+ [dateutil](https://pypi.org/project/python-dateutil/) from
2781+ 2000 until 2038 (limited by dateutil).
27582782 * Tested against Java `java.time` from 2000 to until 2050.
27592783 * Tested against [Hinnant date](https://github.com/HowardHinnant/date)
27602784 using 1-minute resolution from 1975 to 2050. See
2761- [ExtendedValidationUsingHinnantDateTest ](tests/validation/ExtendedValidationUsingHinnantDateTest ).
2785+ [ExtendedHinnantDateTest ](tests/validation/ExtendedHinnantDateTest ).
27622786* `zonedb/` and `zonedbx/` zoneinfo files
27632787 * These statically defined data structures are loaded into flash memory
27642788 using the `PROGMEM` keyword. The vast majority of the data structure
@@ -2831,12 +2855,3 @@ some time to take a closer look in the future.
28312855 SAMD21 Mini Breakout` board. The `MKR Zero` could be using a different
28322856 (more recent?) version of the GCC tool chain. I have not investigated
28332857 this.
2834-
2835-
2836- ## Untested RTC hardware compatibility
2837-
2838- As DS1307 and DS3232 RTC chip have exactly same interface as DS3231 for used
2839- features except temperature on DS1307 (this one lacks this functionality),
2840- this class could be be used to control all of them.
2841-
2842- Any problem with these RTCs please, contact @Naguissa (https://github.com/Naguissa/AceTime)
0 commit comments