GNU date parsing bug (DST-related)

David Madore <[email protected]> Sun, 30 Mar 2003 12:45:03 +0200
Newsgroups gmane.comp.gnu.sh-utils.bugs
Message-ID <[email protected]>
The following shows GNU date in the GNU coreutils version 4.5.9 to
have a parsing bug in certain time zones:

vega david ~ $ TZ=GMT /opt/coreutils-4.5.9/bin/date --date="2003-03-30 02:15:00+0000" +%s
1048990500
vega david ~ $ TZ=Europe/Paris /opt/coreutils-4.5.9/bin/date --date="2003-03-30 02:15:00+0000" +%s
1048994100

(the first number above is correct, the second is not).

Evidently the output of an absolute GMT date such as 2003-03-30
02:15:00 +0000 with +%s should not depend on time zone.  But the
parser is manifestly confused by the fact that the Europe/Paris time
zone's DST switch from 2003-03-30T01:59:59+0100 to
2003-03-30T03:00:00+0200 (incidentally, this leads me also to the
comment that GNU date should recognize dates in the format that uses a
capital T between the date and the time, since this is the ISO
standard for writing a fully qualified date, as above - but I
digress).

In the above example, libc is the GNU libc, and the system is
RedHat-7.3.  The coreutils-4.5.9 package was freshly compiled from the
sources found on alpha.gnu.org

A workaround is to use the -u switch.

Hope this bug-report is useful.

Cheers to all,

-- 
     David A. Madore
    ([email protected],
     http://www.eleves.ens.fr:8080/home/madore/ )