tz strftime %V week numbers are incompatible with Solaris, GNU
Paul Eggert
eggert at twinsun.com
Tue Jul 16 20:53:58 UTC 1996
While testing some code I discovered that the tz strftime week numbers
are incompatible with the %V week numbers generated by Solaris 2.5.1 strftime
and with the GNU C Library strftime. I don't know what the correct
definition of week numbers is (and I don't particularly want to know :-)
but I thought I should report the problem, since it's two against one.
#defining XPG4_1994_04_09 fixes some but not all of the discrepancies.
Here are all examples of discrepancies from 1994 through 1998. Each
column contains the output of strftime applied to "%U %V %W" for the
given date. In the cases marked `*', #defining XPG4_1994_04_09 didn't
remove the discrepancy.
Solaris
date & glibc tz tz with XPG4_1994_04_09
1994-01-01 00 53 00 00 52 00 00 53 00
1994-01-02 01 53 00 01 52 00 01 53 00
1995-01-01 01 53 00 01 52 00 01 53 00
1996-12-30 52 53 53 52 01 53 52 01 53*
1996-12-31 52 53 53 52 01 53 52 01 53*
1997-12-29 52 53 52 52 01 52 52 01 52*
1997-12-30 52 53 52 52 01 52 52 01 52*
1997-12-31 52 53 52 52 01 52 52 01 52*
While we're on the subject, perhaps XPG4 behavior should be the default,
with non-standard behavior being an option.
More information about the tz
mailing list