mainGNU Core Utilities - Support: sr #108179, date returns wrong date with...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

sr #108179: date returns wrong date with ISO8601 short form

Submitter:  None
Submitted:  Tue 13 Nov 2012 09:38:16 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  GNU/Linux

Mon 05 Aug 2013 05:06:38 PM UTC, comment #1: 

The basic format is not suppported yet. There is a bug report about it:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14097

Mihai C. <mihaic>
Tue 13 Nov 2012 09:38:16 PM UTC, original submission:  

I found this in the packaged version of coreutils 8.13 on Debian 7 (currently still in beta), then verified it on a local build of coreutils 8.20.

Per my reading of the Wikipedia article on ISO 8601 (https://en.wikipedia.org/w/index.php?title=ISO_8601&oldid=521173253), these two date strings should both be valid and both represent the same date:

20121113T1200
2012-11-13T12:00

Yet when I pass them both to "date -d" I get different results (the short form gives an unexpected result; the expanded form is correct).  If I replace the 'T' with a space, "date -d" gives me the expected result for both forms.

$ src/date -d "20121113T1200"
Mon Nov 12 21:00:00 PST 2012
$ src/date -d "20121113 1200"
Tue Nov 13 12:00:00 PST 2012
$ src/date -d "2012-11-13 12:00"
Tue Nov 13 12:00:00 PST 2012
$ src/date -d "2012-11-13T12:00"
Tue Nov 13 12:00:00 PST 2012
$ src/date --version
date (GNU coreutils) 8.20
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.
$

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mihaic (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code