GNU bug report logs - #23008
Daylight Savings Time Bug in Date

Previous Next

Package: coreutils;

Reported by: Sarah Corriher <sarah.c <at> healthwyze.org>

Date: Mon, 14 Mar 2016 06:24:02 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.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 23008 in the body.
You can then email your comments to 23008 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#23008; Package coreutils. (Mon, 14 Mar 2016 06:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sarah Corriher <sarah.c <at> healthwyze.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Mon, 14 Mar 2016 06:24:02 GMT) Full text and rfc822 format available.

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

From: Sarah Corriher <sarah.c <at> healthwyze.org>
To: bug-coreutils <at> gnu.org
Subject: Daylight Savings Time Bug in Date
Date: Mon, 14 Mar 2016 01:24:40 -0400
[Message part 1 (text/plain, inline)]
We detected a bug in the date program, which correlates to the daylight 
savings time change. A day disappeared from the date program between 
12:00 AM and 1:00 AM on 3/14/16. The date program began working as 
expected immediately after 1:00 AM. Here is the bizarre output that I 
got for basic commands on 3/14/16:

   $ date -d -0days +%Y-%m-%d
   2016-03-14

   $ date -d -1days +%Y-%m-%d
   2016-03-12

Notice that I was unable to obtain the expected output of 2016-03-13 for 
the day prior. I was able to reproduce this using version 8.13 on 
Debian, and 8.21 on Mint.

-- 
Sarah C. Corriher
Co-author of "Defy Your Doctor and Be Healed"
336-528-4120
http://HealthWyze.org

We're Health Wyze. Have you told your friends about us?

[Message part 2 (text/html, inline)]

Added tag(s) notabug. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Mon, 14 Mar 2016 15:05:01 GMT) Full text and rfc822 format available.

Reply sent to Eric Blake <eblake <at> redhat.com>:
You have taken responsibility. (Mon, 14 Mar 2016 15:05:02 GMT) Full text and rfc822 format available.

Notification sent to Sarah Corriher <sarah.c <at> healthwyze.org>:
bug acknowledged by developer. (Mon, 14 Mar 2016 15:05:02 GMT) Full text and rfc822 format available.

Message #12 received at 23008-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Sarah Corriher <sarah.c <at> healthwyze.org>, 23008-done <at> debbugs.gnu.org,
 GNU bug control <control <at> debbugs.gnu.org>
Subject: Re: bug#23008: Daylight Savings Time Bug in Date
Date: Mon, 14 Mar 2016 09:04:16 -0600
[Message part 1 (text/plain, inline)]
tag 23008 notabug
thanks

On 03/13/2016 11:24 PM, Sarah Corriher wrote:
> We detected a bug in the date program, which correlates to the daylight
> savings time change.

Thanks for the report.  However, this is not a bug, but a FAQ that gets
asked twice a year.  See:

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

> 
>    $ date -d -0days +%Y-%m-%d
>    2016-03-14
> 
>    $ date -d -1days +%Y-%m-%d
>    2016-03-12

When trying to add units of 24 hours (the -1days), only to then display
just a day and not an hour, it's best to start from noon rather than
from a time that might be impacted by daylight savings:

# date -d '12:00pm 2014-03-14 -1day' +%Y-%m-%d
2016-03-13

Otherwise, as you discovered, starting at midnight and going 24 hours
across a day with only 23 hours is likely to skip that day.

I'm closing this as not a bug, but feel free to reply with further
questions or comments.

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

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

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

This bug report was last modified 9 years and 72 days ago.

Previous Next


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