Bug 19496 - 1 hour off in some DST time conversions
Summary: 1 hour off in some DST time conversions
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: sh-utils   
(Show other bugs)
Version: 6.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: bero
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2000-10-20 22:49 UTC by Larry Stephan
Modified: 2007-04-18 16:29 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-10-21 11:44:54 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Larry Stephan 2000-10-20 22:49:25 UTC
date -d '1/1/70 UTC +86400000 seconds'  -- or any number of seconds that
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). 
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.

Note You need to log in before you can comment on or make changes to this bug.