Bug 435766 - coreutils' date returns erroneous values on certain operations
Summary: coreutils' date returns erroneous values on certain operations
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: coreutils   
(Show other bugs)
Version: 4.6
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Ondrej Vasik
QA Contact:
: DAYLIGHT (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2008-03-03 19:07 UTC by Kilian Cavalotti
Modified: 2018-10-20 01:06 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-05-18 20:07:42 UTC
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 13:28:11 UTC

Description Kilian Cavalotti 2008-03-03 19:07:08 UTC
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 18:43:28 UTC
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 19:23:57 UTC
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 20:04:32 UTC
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 20:08:43 UTC
Thank you!

Comment 5 Ondrej Vasik 2008-03-04 20:18:38 UTC
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 06:05:41 UTC
*** Bug 461084 has been marked as a duplicate of this bug. ***

Comment 7 RHEL Product and Program Management 2008-09-05 17:05:35 UTC
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 20:07:42 UTC
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.