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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10455 in the body.
You can then email your comments to 10455 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#10455; Package coreutils. (Sun, 08 Jan 2012 19:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dotan Cohen <dotancohen <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sun, 08 Jan 2012 19:13:02 GMT) Full text and rfc822 format available.

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

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




Information forwarded to bug-coreutils <at> gnu.org:
bug#10455; Package coreutils. (Mon, 09 Jan 2012 06:50:02 GMT) Full text and rfc822 format available.

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

From: Bob Proulx <bob <at> proulx.com>
To: Dotan Cohen <dotancohen <at> gmail.com>
Cc: 10455 <at> debbugs.gnu.org
Subject: Re: bug#10455: Date: Possible bug in ISO-8601 formatted dates
Date: Sun, 8 Jan 2012 23:49:27 -0700
Dotan Cohen wrote:
> It seems that ISO-8601 formated dates are not properly handled by the
> date utility.

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.

* Noteworthy changes in release 8.13 (2011-09-08) [stable]

** New features

  date now accepts ISO 8601 date-time strings with "T" as the
  separator.  It has long parsed dates like "2004-02-29 16:21:42"
  with a space between the date and time strings.  Now it also parses
  "2004-02-29T16:21:42" and fractional-second and time-zone-annotated
  variants like "2004-02-29T16:21:42.333-07:00"

And here is the ChangeLog entry:

        date: support parsing of ISO-8601-with-"T" dates
        Thanks to an improvement in gnulib's parse-datetime module,
        commands like this now succeed (output manually indented):
            $ ./date -u -d 2004-02-29T16:21:42.33+07:00 +%FT%T.%N%z
                           2004-02-29T09:21:42.330000000+0000
        * tests/misc/date: Add a test to exercise the new-in-gnulib
        parsing of ISO8601-with-"T" dates.
        * NEWS (New features): Mention it.
        * gnulib: Update, to pull in this parse-datetime improvement.

Bob




Information forwarded to bug-coreutils <at> gnu.org:
bug#10455; Package coreutils. (Mon, 09 Jan 2012 08:47:01 GMT) Full text and rfc822 format available.

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

From: Dotan Cohen <dotancohen <at> gmail.com>
To: Bob Proulx <bob <at> proulx.com>
Cc: 10455 <at> debbugs.gnu.org
Subject: Re: bug#10455: Date: Possible bug in ISO-8601 formatted dates
Date: Mon, 9 Jan 2012 10:46:30 +0200
On Mon, Jan 9, 2012 at 08:49, Bob Proulx <bob <at> proulx.com> 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!



-- 
Dotan Cohen

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




Reply sent to Bob Proulx <bob <at> proulx.com>:
You have taken responsibility. (Mon, 09 Jan 2012 17:14:03 GMT) Full text and rfc822 format available.

Notification sent to Dotan Cohen <dotancohen <at> gmail.com>:
bug acknowledged by developer. (Mon, 09 Jan 2012 17:14:03 GMT) Full text and rfc822 format available.

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

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 #17 received at 10455-done <at> debbugs.gnu.org (full text, mbox):

From: Dotan Cohen <dotancohen <at> gmail.com>
To: Bob Proulx <bob <at> proulx.com>
Cc: 10455-done <at> debbugs.gnu.org
Subject: Re: bug#10455: Date: Possible bug in ISO-8601 formatted dates
Date: Tue, 10 Jan 2012 03:23:55 +0200
On Mon, Jan 9, 2012 at 19:12, Bob Proulx <bob <at> proulx.com> wrote:
> Good.  I am going to close the bug report ticket with this message
> then.
>

No problem. I cannot test the later versions on any hardware I have
lying around, so when I see my distro up to 8.13 I'll double check. If
you would like me to confirm now do you have a system with a recent
GNU Tools that I could SSH into?


-- 
Dotan Cohen

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




Information forwarded to bug-coreutils <at> gnu.org:
bug#10455; Package coreutils. (Tue, 10 Jan 2012 05:14:02 GMT) Full text and rfc822 format available.

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

From: Bob Proulx <bob <at> proulx.com>
To: Dotan Cohen <dotancohen <at> gmail.com>
Cc: 10455 <at> debbugs.gnu.org
Subject: Re: bug#10455: Date: Possible bug in ISO-8601 formatted dates
Date: Mon, 9 Jan 2012 22:12:49 -0700
Hi Dotan,

Dotan Cohen wrote:
> Bob Proulx wrote:
> > Good.  I am going to close the bug report ticket with this message
> > then.
> 
> No problem. I cannot test the later versions on any hardware I have
> lying around, so when I see my distro up to 8.13 I'll double check. If
> you would like me to confirm now do you have a system with a recent
> GNU Tools that I could SSH into?

For you I would actually give you a login on one of my systems.  But
instead how about if I send you a 'date' that is backported to
Squeeze?  Even though you say you love-to-hate it? :-)  Then you can
play with it and see the current behavior.

Bob




Information forwarded to bug-coreutils <at> gnu.org:
bug#10455; Package coreutils. (Tue, 10 Jan 2012 07:27:01 GMT) Full text and rfc822 format available.

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

From: Dotan Cohen <dotancohen <at> gmail.com>
To: Bob Proulx <bob <at> proulx.com>
Cc: 10455 <at> debbugs.gnu.org
Subject: Re: bug#10455: Date: Possible bug in ISO-8601 formatted dates
Date: Tue, 10 Jan 2012 09:26:23 +0200
On Tue, Jan 10, 2012 at 07:12, Bob Proulx <bob <at> proulx.com> wrote:
> For you I would actually give you a login on one of my systems.  But
> instead how about if I send you a 'date' that is backported to
> Squeeze?  Even though you say you love-to-hate it? :-)  Then you can
> play with it and see the current behavior.
>

Thanks, Bob. I checked with the backported date-8.13 and it performs
as expected for the test case mentioned. That is, the issue is
resolved.

I love to love Debian! I was just embarrassed to mention that I use
Kubuntu at home on a public mailing list. Here, I'm getting over it!
Hence, a love-to-hate Debian-based distro! The backported date ran
fine on Kubuntu. Thank you very much!


-- 
Dotan Cohen

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




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

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

Previous Next


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