GNU bug report logs - #10455
Date: Possible bug in ISO-8601 formatted dates

Previous Next

Package: coreutils;

Reported by: Dotan Cohen <dotancohen <at> gmail.com>

Date: Sun, 8 Jan 2012 19:13:02 UTC

Severity: normal

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Dotan Cohen <dotancohen <at> gmail.com>
Subject: bug#10455: closed (Re: bug#10455: Date: Possible bug in ISO-8601
 formatted dates)
Date: Mon, 09 Jan 2012 17:14:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#10455: Date: Possible bug in ISO-8601 formatted dates

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 10455 <at> debbugs.gnu.org.

-- 
10455: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10455
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Bob Proulx <bob <at> proulx.com>
To: Dotan Cohen <dotancohen <at> gmail.com>
Cc: 10455-done <at> debbugs.gnu.org
Subject: Re: bug#10455: Date: Possible bug in ISO-8601 formatted dates
Date: Mon, 9 Jan 2012 10:12:42 -0700
Dotan Cohen wrote:
> Bob Proulx wrote:
> > GNU date didn't learn how to handle ISO-8601 until very recently.
> > Your version 8.5 doesn't have that code yet.  Here is the NEWS file
> > entry for the change as it went into the recent 8.13 release.
> 
> Thanks, Bob. Have a great week!

Good.  I am going to close the bug report ticket with this message
then.

Bob

[Message part 3 (message/rfc822, inline)]
From: Dotan Cohen <dotancohen <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Date: Possible bug in ISO-8601 formatted dates
Date: Sun, 8 Jan 2012 19:22:09 +0200
It seems that ISO-8601 formated dates are not properly handled by the
date utility. The date utility seems to erroneously add
timezone-shifting when using ISO-8601 dates. This example is fine (see
the date roundtrip to back where it started):
✈saturn:~$ date +%s -d "2006-12-31 22:00"
1167595200
✈saturn:~$ date -d @1167595200
Sun Dec 31 22:00:00 IST 2006

However, adding a "t" between the date and hour (as per ISO 8601)
breaks the roundtrip (the timestamp is wrong):
✈saturn:~$ date +%s -d "2006-12-31t22:00"
1167577200
✈saturn:~$ date -d @1167577200
Sun Dec 31 17:00:00 IST 2006

This is on a love-to-hate Debian-based distro, with GNU coreutils 8.5.
I can confirm the issue on CentOS with date 5.97. Without the "t" the
timestamp is correct:
[root <at> gs beer]# date +%s -d "2006-12-31 22:00"
1167602400
[root <at> gs beer]# date -d @1167602400
Sun Dec 31 22:00:00 UTC 2006

And with it, the timestamp is wrong.
[root <at> gs beer]# date +%s -d "2006-12-31t22:00"
1167577200
[root <at> gs beer]# date -d @1167577200
Sun Dec 31 15:00:00 UTC 2006

Note that IST (from the first server) is UTC+2.


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com



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

Previous Next


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