There appears to be a bug in zic when leapseconds are provided, for any time zone transition near a leapsecond. The bug is that after reading in the Leaps as Posix seconds in the trans[] array, adjleap() is called. This converts these to genuine UTC seconds. However, this array is then used to fixup transition times which are in posix seconds, by for (i = 0; i < timecnt; ++i) { j = leapcnt; while (--j >= 0) if (ats[i] >= trans[j]) { ats[i] = tadd(ats[i], corr[j]); break; } } ats[] is stored in posix seconds, but trans[] is in leap seconds. The effect is that for Europe/London, the transition on 1996-01-01 00:00:00 is actually set to be at 1995-12-31 23:59:60, i.e. on the leap second (820454419). Any transition in the range 1996-01-01 00:00:00 to 00:00:18 is similarly off by one second. The fix is obvious in principle (have a copy of trans[] that isn't leap-second adjusted, and use that in the code above), but not all the uses of trans[] in the code are obvious to me (what are Rolling leapsecs?). I'd also suggest that zic reject any transition in its input with a second=60. It's usually run without a leap file so there's no point in implementing the correct behaviour for that case. Many thanks, David Robinson
Here's what's happening with leap seconds now, as divined using zdump: Script started on Tue 13 Jun 2006 11:56:20 AM EDT elsie$ cd ~/src/tz elsie$ make install TOPDIR=$PWD/tmp REDO=right_only >&- elsie$ ./zdump -v America/New_York | grep 1972 America/New_York Sun Apr 30 06:59:59 1972 UTC = Sun Apr 30 01:59:59 1972 EST isdst=0 America/New_York Sun Apr 30 07:00:00 1972 UTC = Sun Apr 30 03:00:00 1972 EDT isdst=1 America/New_York Fri Jun 30 23:59:60 1972 UTC = Fri Jun 30 19:59:60 1972 EDT isdst=1 America/New_York Sat Jul 1 00:00:00 1972 UTC = Fri Jun 30 20:00:00 1972 EDT isdst=1 America/New_York Sun Oct 29 05:59:59 1972 UTC = Sun Oct 29 01:59:59 1972 EDT isdst=1 America/New_York Sun Oct 29 06:00:00 1972 UTC = Sun Oct 29 01:00:00 1972 EST isdst=0 America/New_York Sun Dec 31 23:59:60 1972 UTC = Sun Dec 31 18:59:60 1972 EST isdst=0 America/New_York Mon Jan 1 00:00:00 1973 UTC = Sun Dec 31 19:00:00 1972 EST isdst=0 elsie$ exit script done on Tue 13 Jun 2006 11:56:54 AM EDT What should be different? --ado
participants (2)
-
David Robinson -
Olson, Arthur David (NIH/NCI) [E]