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

 
 

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

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

Submitted by:  None
Submitted on:  Tue 13 Nov 2012 09:38:16 PM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 3 - NormalStatus: None
Privacy: PublicAssigned to: None
Originator Email: -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

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup