Bug 35960 - "date" arithmetic is weird around 1 apr 2001
"date" arithmetic is weird around 1 apr 2001
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: sh-utils (Show other bugs)
7.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-04-15 05:14 EDT by Felix Lee
Modified: 2007-04-18 12:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-04-15 05:14:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Felix Lee 2001-04-15 05:14:33 EDT
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 15:46:59 EDT
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.