Bug 35960 - "date" arithmetic is weird around 1 apr 2001
Summary: "date" arithmetic is weird around 1 apr 2001
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: sh-utils
Version: 7.0
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-04-15 09:14 UTC by Felix Lee
Modified: 2007-04-18 16:32 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-04-15 09:14:37 UTC
Embargoed:


Attachments (Terms of Use)

Description Felix Lee 2001-04-15 09:14:33 UTC
compare these commands:
   $ date -u -d '31 mar 2001 utc + 86400 seconds'
   Sun Apr  1 00:00:00 UTC 2001

   $ date -u -d '1 apr 2001 utc + 86400 seconds'
   Mon Apr  2 01:00:00 UTC 2001

   $ date -u -d '2 apr 2001 utc + 86400 seconds'
   Tue Apr  3 00:00:00 UTC 2001

the second one is wrong by an hour.  any date calculation that
crosses some time in 1 apr 2001 is wrong by an hour.

another way this problem manifests, compare:
   $ date
   Sun Apr 15 02:12:03 PDT 2001

   $ date -d "1 jan 1970 utc + $(date +%s) seconds"
   Sun Apr 15 03:12:09 PDT 2001

the two should be almost the same, but the second one
is one hour in the future.

Comment 1 Bernhard Rosenkraenzer 2001-04-15 19:46:59 UTC
Works in the current release (sh-utils-2.0-13, installing just that package on 
a 7.0 system should do).




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