bug in zic for Rule and Zone changing simultaneously?

Paul Eggert eggert at twinsun.com
Wed May 1 22:40:04 UTC 1996


I found 23 bugs in the latest tz database.  I enclose two detailed
examples below, and a brief summary of all the bugs.  It appears that
zic has problems when applying Zone and Rule changes simultaneously.


Example 1.  The edited input is:

# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LET
Rule	Falk	1985	max	-	Sep	Sun>=9	0:00	1:00	D
# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
Zone Atlantic/Stanley	-3:00	Falk	E%sT	1985 Sep 15
			-4:00	Falk	A%sT

The zdump -v output is:

Atlantic/Stanley  Sun Sep 15 02:59:59 1985 GMT = Sat Sep 14 23:59:59 1985 EST isdst=0
Atlantic/Stanley  Sun Sep 15 03:00:00 1985 GMT = Sat Sep 14 23:00:00 1985 AST isdst=0
Atlantic/Stanley  Sun Sep 15 03:59:59 1985 GMT = Sat Sep 14 23:59:59 1985 AST isdst=0
Atlantic/Stanley  Sun Sep 15 04:00:00 1985 GMT = Sun Sep 15 01:00:00 1985 ADT isdst=1

zdump claims that inhabitants of Stanley changed their clocks twice
that night, when they changed them only once.  The transition should
have been from
1985-09-14 23:59:59 -0300 (EST) to
1985-09-15 00:00:00 -0400 (ADT), but zic applied `Zone' first, yielding
1985-09-14 23:00:00 -0200 (EDT), and then one hour later applied `Rule',
yielding the proper time afterwards; but there's a one-hour period of
incorrect times.


Example 2.  The input is:

# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LET
Rule	Regina	1905	only	-	Sep	 1	0:00	0	S
# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
Zone	America/Regina	-6:58:36 -	LMT	1905 Sep
			-7:00	Regina	M%sT	1966 Apr 15

The zdump output is:

America/Regina  Fri Sep  1 06:58:35 1905 GMT = Thu Aug 31 23:59:59 1905 LMT isdst=0
America/Regina  Fri Sep  1 06:58:36 1905 GMT = Thu Aug 31 23:58:36 1905 LMT isdst=0
America/Regina  Fri Sep  1 06:59:59 1905 GMT = Thu Aug 31 23:59:59 1905 LMT isdst=0
America/Regina  Fri Sep  1 07:00:00 1905 GMT = Fri Sep  1 00:00:00 1905 MST isdst=0

Again, there are two transitions where there should be one, and it's
because the Zone was applied before the Rule, when they were meant to
be applied simultaneously.  In this case, the erroneous period is only
84 seconds long.


Here is a list of the 23 bugs I found.  Each line has the following
columns:

timezone name
first time_t value in the erroneous period (1)
first time_t value after the erroneous period is over (2)
ctime applied to (1)
ctime applied to (2)

America/Asuncion 134017200 134020800 Sun Mar 31 23:00:00 1974 Mon Apr  1 00:00:00 1974
America/Barbados -1199217720 -1199217600 Thu Dec 31 23:58:00 1931 Fri Jan  1 00:00:00 1932
America/Belize -1822500432 -1822500000 Sun Mar 31 23:52:48 1912 Mon Apr  1 00:00:00 1912
America/Costa_Rica -1545071040 -1545069600 Fri Jan 14 23:36:00 1921 Sat Jan 15 00:00:00 1921
America/El_Salvador -1546279392 -1546279200 Fri Dec 31 23:56:48 1920 Sat Jan  1 00:00:00 1921
America/Juneau 436352400 436356000 Sun Oct 30 01:00:00 1983 Sun Oct 30 01:00:00 1983
America/Managua 161758800 161762400 Sat Feb 15 23:00:00 1975 Sun Feb 16 00:00:00 1975
America/Menominee 104914800 104918400 Sun Apr 29 01:00:00 1973 Sun Apr 29 03:00:00 1973
America/Port-au-Prince -1670483460 -1670482800 Wed Jan 24 11:49:00 1917 Wed Jan 24 12:00:00 1917
America/Regina -2030202084 -2030202000 Thu Aug 31 23:58:36 1905 Fri Sep  1 00:00:00 1905
America/Santo_Domingo -1159773600 -1159772400 Sat Apr  1 11:40:00 1933 Sat Apr  1 12:00:00 1933
America/Scoresbysund 354679200 354682800 Sun Mar 29 01:00:00 1981 Sun Mar 29 03:00:00 1981
Asia/Amman -1230776624 -1230775200 Wed Dec 31 23:36:16 1930 Thu Jan  1 00:00:00 1931
Asia/Damascus -1577931912 -1577930400 Wed Dec 31 23:34:48 1919 Thu Jan  1 00:00:00 1920
Asia/Istanbul 482792400 482796000 Fri Apr 19 23:00:00 1985 Sat Apr 20 01:00:00 1985
Asia/Jerusalem -1641003660 -1641002400 Mon Dec 31 23:39:00 1917 Tue Jan  1 00:00:00 1918
Asia/Nicosia -1518920008 -1518919200 Sun Nov 13 23:46:32 1921 Mon Nov 14 00:00:00 1921
Asia/Shanghai -1325491552 -1325491200 Sat Dec 31 23:54:08 1927 Sun Jan  1 00:00:00 1928
Atlantic/Azores -1849557900 -1849557600 Tue May 23 23:55:00 1911 Wed May 24 00:00:00 1911
Atlantic/Stanley -1824235740 -1824235200 Mon Mar 11 23:51:00 1912 Tue Mar 12 00:00:00 1912
Atlantic/Stanley 495601200 495604800 Sat Sep 14 23:00:00 1985 Sun Sep 15 01:00:00 1985
Europe/Brussels -1604282400 -1604278800 Sat Mar  1 22:00:00 1919 Sun Mar  2 00:00:00 1919
Pacific/Noumea -1829387148 -1829386800 Fri Jan 12 23:54:12 1912 Sat Jan 13 00:00:00 1912



More information about the tz mailing list