GNU bug report logs - #10413
Invalid date result in specific date operations

Previous Next

Package: coreutils;

Reported by: Vicente Pérez M <vperez <at> citymovil.cl>

Date: Sat, 31 Dec 2011 21:20:01 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 10413 in the body.
You can then email your comments to 10413 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#10413; Package coreutils. (Sat, 31 Dec 2011 21:20:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vicente Pérez M <vperez <at> citymovil.cl>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sat, 31 Dec 2011 21:20:01 GMT) Full text and rfc822 format available.

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

From: Vicente Pérez M <vperez <at> citymovil.cl>
To: bug-coreutils <at> gnu.org
Subject: Invalid date result in specific date operations
Date: Thu, 29 Dec 2011 15:02:46 -0300
How to repeat:


date -d '2011-08-21 + 1 DAY' +%Y-%m-%d
date -d '2010-10-10 + 1 DAY' +%Y-%m-%d

These dates is just when change from normal time UTC-4 to dts UCT-3

result: invalid date

The same operation with --utc works fine.
date -d '2011-08-21 + 1 DAY' +%Y-%m-%d --utc
date -d '2010-10-10 + 1 DAY' +%Y-%m-%d --utc











Added tag(s) notabug. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Sat, 31 Dec 2011 22:44:02 GMT) Full text and rfc822 format available.

Reply sent to Eric Blake <eblake <at> redhat.com>:
You have taken responsibility. (Sat, 31 Dec 2011 22:44:02 GMT) Full text and rfc822 format available.

Notification sent to Vicente Pérez M <vperez <at> citymovil.cl>:
bug acknowledged by developer. (Sat, 31 Dec 2011 22:44:02 GMT) Full text and rfc822 format available.

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

From: Eric Blake <eblake <at> redhat.com>
To: Vicente Pérez M <vperez <at> citymovil.cl>
Cc: 10413-done <at> debbugs.gnu.org
Subject: Re: bug#10413: Invalid date result in specific date operations
Date: Sat, 31 Dec 2011 15:39:58 -0700
[Message part 1 (text/plain, inline)]
tag 10413 notabug
thanks

On 12/29/2011 11:02 AM, Vicente Pérez M wrote:
> How to repeat:
> 
> 
> date -d '2011-08-21 + 1 DAY' +%Y-%m-%d
> date -d '2010-10-10 + 1 DAY' +%Y-%m-%d
> 
> These dates is just when change from normal time UTC-4 to dts UCT-3
> 
> result: invalid date
> 
> The same operation with --utc works fine.
> date -d '2011-08-21 + 1 DAY' +%Y-%m-%d --utc
> date -d '2010-10-10 + 1 DAY' +%Y-%m-%d --utc

Thanks for the report.  You failed to mention your exact TZ settings,
although you hinted at it via 'dts UTC-3', but the behavior you observed
is by design and not a bug.  In particular time zones, attempts to land
in a time that falls during the skipped hour are rejected, and using UTC
(which has no daylight savings) is a correct way to avoid the issue.
Another way is to pinpoint times to noon rather than the default of
midnight (no known time zone has a daylight savings transition at noon),
since your particular time zone appears to be among those zones where
the daylight savings rules kick in at midnight:

date -d '2011-08-21 12:00pm + 1 day' +%Y-%m-%d

More on this topic can be found in the FAQ:
https://www.gnu.org/software/coreutils/faq/#The-date-command-is-not-working-right_002e

-- 
Eric Blake   eblake <at> 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. (Sun, 29 Jan 2012 12:24:02 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 146 days ago.

Previous Next


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