GNU bug report logs - #11098
date --yesterday wrong result

Previous Next

Package: coreutils;

Reported by: Hugo Guérineau <hugo.guerineau <at> wwsight.com>

Date: Mon, 26 Mar 2012 16:43:01 UTC

Severity: normal

Tags: notabug

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

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

Bug is archived. No further changes may be made.

Full log


Message #15 received at control <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)]

This bug report was last modified 6 years and 209 days ago.

Previous Next


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