bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug-coreutils date command


From: Richard Narum
Subject: bug-coreutils date command
Date: Mon, 3 Dec 2007 15:05:26 -0600 (CST)

FYI, 

I'm not sure if you would call this a bug or not but I'm wondering why the GNU 
date command doesn't have the correct time adjustment for daylight savings from 
years past on its output when using an input date string to generate its 
output. It seems to have the current rules applied to all dates, i.e. in 2007 
daylight savings starts second Sunday in March and ends the first Sun in 
November while in 2006 it should start on the first Sunday in April ending the 
last Sunday in October. I live in the Central Timezone, TZ=CST6CDT, and have 
found that the time adjustments for previous years don't line up to their 
proper dates. It doesn't seem like there is any daylight savings rules based on 
year. The site http://aa.usno.navy.mil/faq/docs/daylight_time.php has some 
reference to the rules I am talking about. 

I am currently running GNU coreutils 6.9 with Cygwin on Windows XP version 
"CYGWIN_NT-5.1 1.5.24(0.156/4/2) 2007-01-31 10:57". 

The following commands shows dates when CST switches to CDT and back. 

$ export TZ=CST6CDT 
$ i=$(date --date="01/01/2005" +%s) 
$ while true; do date --date="1970-01-01 00:00:00 $i sec UTC"; ((i=$i+86400)); 
done 

Summary: 

Sun Mar 12 00:00:00 CST 2006 (should be Sun Apr 2 00:00:00 CST 2006) 
Mon Mar 13 01:00:00 CDT 2006 (should be Mon Apr 3 01:00:00 CDT 2006) 
Sun Nov 5 01:00:00 CDT 2006 (should be Sun Oct 29 01:00:00 CDT 2006) 
Mon Nov 6 00:00:00 CST 2006 (should be Mon Oct 30 00:00:00 CST 2006) 

Sun Mar 11 00:00:00 CST 2007 
Mon Mar 12 01:00:00 CDT 2007 
Sun Nov 4 01:00:00 CDT 2007 
Mon Nov 5 00:00:00 CST 2007 

What I got out of the above article the rules would be something like the 
following. 

1974 starts Jan 6 ends last Sun in Oct 
1975 starts Feb 23 ends last Sun in Oct 
1976-1986 starts last Sun in Apr ends last Sun in Oct 
1987-2006 starts first Sun in Apr ends last Sun in Oct 
2007-???? starts second Sun in Mar ends first Sun in Nov 

Could someone shed some light on why maybe additional rules are not applied? 

Thanks, 

Richard Narum, Design/CAD Systems Engineer 
Applied Engineering, Inc. 
1025 Airport Road 
Bismarck, ND 58504 
Phone: 701-255-1137 
Fax: 701-255-1046 
www.ae-solutions.com 
-- 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]