[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug in "date" ?
From: |
Manuel de la Torre Juárez |
Subject: |
bug in "date" ? |
Date: |
Tue, 11 Jun 2002 10:26:18 -0700 |
Hi,
date (from GNU sh-utils 2.0 Release 50) seems to be skipping one hour at
the beginning of April 2001 on
my DELL Inspiron 8100:
I just made the following test:
> date --date="2001-04-01 00:00" +%s
986112000
> date --date="2001-04-01 23:00" +%s
986191200
> date --date="2001-04-02 00:00" +%s
986194800
>echo '(986194800-986112000)/3600' | bc -l
23.00000000000000000000
That is, Apr 1st of 2001 seems to have had only 23 hours (April fools
day !)
If I try the alternative, which is
> date -d 2001-04-01 +%s
986112000
> date -d 2001-04-02 +%s
986194800
Let us add now 23 hours to the first result of date -d:
> echo '23*3600 + 986112000' |bc -l
986194800
But this is precisely the same number as would be obtained for
date -d 2001-04-02 +%s ---> 1 hour is missing.
This 1 hour offset seems persistent until 2001-10-29 when it is
disappears.
Any reason for that ?
Manuel de la Torre.
P.S. If the same exercise is repeated for a day previous to 2001-04-01
or after 2001-10-29, date returns consistent values. For example,
repeating the previous commands
for 2001-02-01, and 2001-02-02 does not produce the same type of
inconsistency.
> date -d 2001-02-02 +%s
981100800
> echo "23*3600 + `date -d 2001-02-01 +%s`" | bc -l
981097200
both numbers differ now by 3600 seconds as is expected
The problem does not occur for 2002.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug in "date" ?,
Manuel de la Torre Juárez <=