Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 435766 - coreutils' date returns erroneous values on certain operations
coreutils' date returns erroneous values on certain operations
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: coreutils (Show other bugs)
x86_64 Linux
low Severity medium
: rc
: ---
Assigned To: Ondrej Vasik
: DAYLIGHT (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2008-03-03 14:07 EST by Kilian Cavalotti
Modified: 2018-10-19 21:06 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-05-18 16:07:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:0959 normal SHIPPED_LIVE coreutils bug fix update 2009-05-18 09:28:11 EDT

  None (edit)
Description Kilian Cavalotti 2008-03-03 14:07:08 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.8 (like Gecko) (Debian)

Description of problem:
the coreutils' date utility can return wrong values on certain dates 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
$ date -d '2007/11/04 + 1 week' +%Y/%m/%d
$ date -d '2007/11/04 + 7 days' +%Y/%m/%d

Actual Results:

Expected Results:

Additional info:
$ date -d '2007/10/29 + 7 days' +%Y/%m/%d
$ date -d '2007/10/28 + 7 days' +%Y/%m/%d
Comment 1 Ondrej Vasik 2008-03-04 13:43:28 EST
It seems to be not a bug and to be related to the daylight saving time change.
Could you please specify your LC_TIME/LC_ALL/TZ setting? I think you can avoid
this issue easily by adding 1 or 2 hours to your commands or by using UTC time
as recommended by info pages / coreutils manual. 

or info date (date input formats->Relative-items-in-date-strings).
Comment 2 Kilian Cavalotti 2008-03-04 14:23:57 EST
Indeed, this happens around the daylight savings date (PST/PDT):

$ ls -l /etc/localtime
lrwxrwxrwx  1 root root 30 Mar  4 
11:19 /etc/localtime -> /usr/share/zoneinfo/US/Pacific
$ date -d '2007/10/28 + 7 days' ; date -d '2007/10/29 + 7 days'
Sun Nov  4 00:00:00 PDT 2007
Sun Nov  4 23:00:00 PST 2007

But on Debian, running the same commands with the same settings, I got what I 
think is the right behavior:

debian$ dpkg -l coreutils
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: 
||/ Name                                   Version                                
ii  coreutils                              5.97-5.3                               
The GNU core utilities
debian$ ls -l /etc/localtime
lrwxrwxrwx 1 root root 30 2008-03-04 
11:19 /etc/localtime -> /usr/share/zoneinfo/US/Pacific
debian$ date -d '2007/10/28 + 7 days' ; date -d '2007/10/29 + 7 days'
Sun Nov  4 00:00:00 PDT 2007
Mon Nov  5 00:00:00 PST 2007

Comment 3 Ondrej Vasik 2008-03-04 15:04:32 EST
Thanks for quick response and clarification.
Issue was fixed by upstream between coreutils-5.2.1 (RHEL-4) and coreutils-5.97
(RHEL-5), so is fixed in RHEL-5 and Fedoras.

This is upstream commit with the fix of that issue. 

Problem will get fixed in RHEL-4 in next maintainance release.
Comment 4 Kilian Cavalotti 2008-03-04 15:08:43 EST
Thank you!
Comment 5 Ondrej Vasik 2008-03-04 15:18:38 EST
Oops - I meant next maintainance release of RHEL-4 coreutils (definitely not
RHEL 4.7). So it will take some time - but you could use this upstream patch
meanwhile if you need the fix sooner.
Comment 6 Ondrej Vasik 2008-09-04 02:05:41 EDT
*** Bug 461084 has been marked as a duplicate of this bug. ***
Comment 7 RHEL Product and Program Management 2008-09-05 13:05:35 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 14 errata-xmlrpc 2009-05-18 16:07:42 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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