Bug 19496

Summary: 1 hour off in some DST time conversions
Product: [Retired] Red Hat Linux Reporter: Larry Stephan <larry.stephan>
Component: sh-utilsAssignee: bero
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: dr
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-21 11:44:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Larry Stephan 2000-10-20 22:49:25 UTC
date -d '1/1/70 UTC +86400000 seconds'  -- or any number of seconds that
results
in a date during daylight savings time -- returns a time one hour later
than it should.
The example returns 'Tue Sep 26 21:00:00 EDT 1972', the correct answer is
at 20:00,
which corresponds to 00:00 UTC.  (86400000 seconds is exactly 1000 days). 
For
date expressions that result in EST, the answer is correct.  In other
words, EST and EDT
are reported 2 hours apart, not one hour.  This problem may not be in date,
but somewhere else: I compiled date from gnu sources, and had the same
problem.  Note that if using EST and not UTC for a starting point, the
problem does not appear.  Also note that I'm doing this while EDT is in
effect.  Compiling gnu date (same version) on AIX did not show the
problem.  I have used both mktime() and localtime() in these time ranges
and am pretty sure I saw no problem.  This problem also appeared in RH 5.1
when I compiled gnu date (sh-utils-1.16, again from gnu sources).  As I
recall, the delivered date program in 5.1 was seriously buggy, but I may be
thinking of an earlier version.  As I find your site a bit confusing, you
may already know about this, I apologise if I have missed it as I checked.

Comment 1 Bernhard Rosenkraenzer 2001-03-06 13:47:26 UTC
This is fixed in the current version.