thanhlong203 / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

DateTime.to*IsoString produces string with space instead of T between date and time #234

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. var d = new goog.date.DateTime();
2. d.toIsoString(true,true);
3. d.toUTCIsoString(true,true);

What is the expected output? What do you see instead?
Expected: 2010-11-19T23:48:30Z
Actual: 2010-11-19 23:48:30Z

What version of the product are you using? On what operating system?

Please provide any additional information below.

According to wikipedia (well, the version it's at right now anyway), having a 
space in the ISO 8601 string signifies two separate entities - a date, followed 
by a time - rather than a discrete datetime entity. While I understand how this 
might be more readable, and after all the verbose flag is set, but Google 
Storage wants a verbose ISO8601 string for its 'expiration' parameter, and it 
wants the T and doesn't like the space, so for the sake of those of us who want 
to use this function in code, the 'T' is more useful.

Original issue reported on code.google.com by jer...@google.com on 19 Nov 2010 at 11:54

Attachments:

GoogleCodeExporter commented 8 years ago
ISO 8601 allows space as separator. See section 5.6 of 
http://www.ietf.org/rfc/rfc3339.txt

If you need 'T' as separator, you can serialize the datetime with 
toXmlDateTime().

Original comment by pall...@google.com on 22 Nov 2010 at 9:47

GoogleCodeExporter commented 8 years ago
Issue 433 has been merged into this issue.

Original comment by pall...@google.com on 12 Mar 2012 at 9:23