Howard Hinnant a610f087c1 Add support for the zic-compiled OS-supplied time zone DB:
*  Avoids the need to download the IANA database.

*  Heavily based on contributions by Aaron Bishop.

*  Turn on with -DUSE_OS_TZDB, off by default.

*  Not supported on Windows.

*  Disables HAS_REMOTE_API.

*  get_tzdb().version only supported on Apple.  This string has
   the value "unknown" elsewhere.

*  Leap second support is missing on Apple, and may not be on your
   platform either (please report).  Leap second support is enabled,
   disabled with -DMISSING_LEAP_SECONDS.

   Without leap second support, utc_time, tai_time, and gps_time (and
   those clocks) are not available.

*  On Apple, time zone transitions are only supported in the range:

   1901-12-13 20:45:52 to 2038-01-19 03:14:07

*  On Linux, time zone transitions are only as far in the future as
   the OS-provided transitions go.  There is no support for POSIX-
   style transitions.
2017-06-04 21:04:53 -04:00
..
2015-08-15 16:00:42 -04:00
2016-06-16 22:07:05 -04:00

To test: * Install tz.cpp by downloading the IANA timezone database at: http://www.iana.org/time-zones You only need the data, not the code.

  • Change the string install in tz.cpp to point to your downloaded IANA database.

  • Compile validate.cpp along with tz.cpp.

  • Run the binary and direct the terminal output to a temporary file.

  • Unzip the tzdata file that has the version corresponding to the IANA database you downloaded (e.g. tzdata2015f.txt.zip).

  • Compare the unzipped txt file with the output of your validate test program. If they are identical, the test passes, else it fails.

Miscellaneous:

You can also compare one version of the tzdatabase with another using these uncompressed text files. The text files contain for each timezone its initial state, and each {offset, abbreviation} change contained in the database up through the year 2035. As the database versions change, minor updates to the set of these transitions are typically made, typically due to changes in government policies.

The tests in this section will run much faster with optimizations cranked up.