Bug 35960

Summary: "date" arithmetic is weird around 1 apr 2001
Product: [Retired] Red Hat Linux Reporter: Felix Lee <flee>
Component: sh-utilsAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: medium    
Version: 7.0   
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: 2001-04-15 09:14:37 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 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).