GNU bug report logs - #11101
Incorrect relative dates the day after DST switchover

Previous Next

Package: coreutils;

Reported by: chip <at> seraphine.us

Date: Tue, 27 Mar 2012 16:49:01 UTC

Severity: normal

Tags: notabug

Merged with 11098, 11125, 15785, 18159, 18479, 20523

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11101 in the body.
You can then email your comments to 11101 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#11101; Package coreutils. (Tue, 27 Mar 2012 16:49:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to chip <at> seraphine.us:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 27 Mar 2012 16:49:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: chip <at> seraphine.us
To: bug-coreutils <at> gnu.org
Subject: Incorrect relative dates the day after DST switchover
Date: Tue, 27 Mar 2012 16:04:51 -0000
Shortly after the DST jump in the United States on March 11th, the 'date'
command returned an incorrect relevant date for the first hour after
midnight.   See text capture below.

Note that 2am on March 11th is the official date change; therefore these
commands are illustrating how the relative date is incorrect in the first
hour of the first day after the time change (i.e. are returning the value
one would expect if no time change had occurred).

[root ~]# date --version
date (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.
[root ~]# date
Mon Mar 12 10:58:37 CDT 2012
[root ~]# date -d yesterday +%F
2012-03-11
[root ~]# service ntpd stop
Shutting down ntpd: [ OK ]
[root ~]# date
Mon Mar 12 11:01:08 CDT 2012
[root ~]# date 03120015.00
Mon Mar 12 00:15:00 CDT 2012
[root ~]# date -d yesterday +%F
2012-03-10





Information forwarded to bug-coreutils <at> gnu.org:
bug#11101; Package coreutils. (Tue, 27 Mar 2012 17:13:02 GMT) Full text and rfc822 format available.

Message #8 received at 11101 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: chip <at> seraphine.us
Cc: 11101 <at> debbugs.gnu.org
Subject: Re: bug#11101: Incorrect relative dates the day after DST switchover
Date: Tue, 27 Mar 2012 10:41:11 -0600
[Message part 1 (text/plain, inline)]
forcemerge 11098 11101
thanks

On 03/27/2012 10:04 AM, chip <at> seraphine.us wrote:
> Shortly after the DST jump in the United States on March 11th, the 'date'
> command returned an incorrect relevant date for the first hour after
> midnight.   See text capture below.

Thanks for the report.  However, you're the second person this week, and
adding to a long line of duplicate reporters in prior years, to notice
that 'date' is behaving as we have documented it.

https://lists.gnu.org/archive/html/bug-coreutils/2012-03/msg00102.html

'yesterday' means 'subtract 24 hours', but if you start at midnight
after a 23-hour day, subtracting 24 hours really does cross 2 calendar
dates.  If you want to avoid this issue, base your relative calculations
off of noon, not midnight, as suggested in our FAQ:

https://www.gnu.org/software/coreutils/faq/#The-date-command-is-not-working-right_002e

> date (GNU coreutils) 5.97

That's rather old; we just released 8.16.

-- 
Eric Blake   eblake <at> redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Forcibly Merged 11098 11101. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Tue, 27 Mar 2012 17:14:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#11101; Package coreutils. (Tue, 27 Mar 2012 18:06:03 GMT) Full text and rfc822 format available.

Message #13 received at 11101 <at> debbugs.gnu.org (full text, mbox):

From: chip <at> seraphine.us
To: "Eric Blake" <eblake <at> redhat.com>
Cc: 11101 <at> debbugs.gnu.org, chip <at> seraphine.us
Subject: Re: bug#11101: Incorrect relative dates the day after DST switchover
Date: Tue, 27 Mar 2012 17:34:07 -0000
Well, if one assumes the point of allowing 'human-friendly' relative dates
such as 'yesterday' is to make usage more intuitive, then the
24-hour-offset is probably incorrect behavior.  That would explain the
quantity of bug reports you are seeing.

Perhaps the 'yesterday' directive ought to just go ahead and assume the
recommended noon reference point, rather than the current moment?  That
would certainly reflect the general meaning of the term 'yesterday' more
accurately.

It seems odd to explicitly permit a natural-language term and then use a
definition for it that differs from what a natural-language user probably
means.




Information forwarded to bug-coreutils <at> gnu.org:
bug#11101; Package coreutils. (Tue, 27 Mar 2012 18:11:02 GMT) Full text and rfc822 format available.

Message #16 received at 11101 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: chip <at> seraphine.us
Cc: 11101 <at> debbugs.gnu.org
Subject: Re: bug#11101: Incorrect relative dates the day after DST switchover
Date: Tue, 27 Mar 2012 11:38:39 -0600
[Message part 1 (text/plain, inline)]
On 03/27/2012 11:34 AM, chip <at> seraphine.us wrote:
> Well, if one assumes the point of allowing 'human-friendly' relative dates
> such as 'yesterday' is to make usage more intuitive, then the
> 24-hour-offset is probably incorrect behavior.  That would explain the
> quantity of bug reports you are seeing.
> 
> Perhaps the 'yesterday' directive ought to just go ahead and assume the
> recommended noon reference point, rather than the current moment?  That
> would certainly reflect the general meaning of the term 'yesterday' more
> accurately.
> 
> It seems odd to explicitly permit a natural-language term and then use a
> definition for it that differs from what a natural-language user probably
> means.

You are welcome to submit a patch to gnulib to change getdate.y, and to
coreutils to document your desired improved semantic change to relative
date computations.  It's just that it is such a complex patch, and the
fact that we have a documented workaround, that no one has been bothered
enough to submit a patch so far.

-- 
Eric Blake   eblake <at> redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Forcibly Merged 11098 11101 11125. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Thu, 29 Mar 2012 18:34:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 02 May 2012 11:24:02 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Tue, 04 Aug 2015 22:32:02 GMT) Full text and rfc822 format available.

Forcibly Merged 11098 11101 11125 18159 18479 20523. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Tue, 04 Aug 2015 22:32:02 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Aug 2015 22:43:01 GMT) Full text and rfc822 format available.

Merged 11098 11101 11125 15785 18159 18479 20523. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 19 Oct 2018 23:15:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 11098 <at> debbugs.gnu.org and Hugo Guérineau <hugo.guerineau <at> wwsight.com> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 24 Oct 2018 21:59:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 22 Nov 2018 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 156 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.