[issue23332] datetime.isoformat() -> explicitly mark UTC string as such

2015-01-27 Thread Mirko Vogt
New submission from Mirko Vogt: I trapped into a pitfall today with web programming using DateTime.isoformat() in the backend and Javascript on the frontend side. isoformat() string'yfies a DateTime-object according to ISO 8601, which states that, if no timezone is specified, the stri

[issue23332] datetime.isoformat() -> explicitly mark UTC string as such

2015-01-27 Thread Mirko Vogt
Mirko Vogt added the comment: Both implementations behave according the standard. If you assume otherwise you violate the standard - as JavaScript does. If that change would break software, that software was broken from the beginning

[issue23332] datetime.isoformat() -> explicitly mark UTC string as such

2015-01-27 Thread Mirko Vogt
Mirko Vogt added the comment: Actually I'm not sure anymore whether NOT specifying a timezone is valid at all. Even though the Spidermonkey documentation itself states, that it doesn't behave according to the ISO standard, several documents say that specifying the timezone is cruci

[issue23332] datetime.isoformat() -> explicitly mark UTC string as such

2015-01-27 Thread Mirko Vogt
Mirko Vogt added the comment: from datetime import * In [4]: datetime.utcnow().isoformat() Out[4]: '2015-01-27T18:51:18.332566' When using utcnow() e.g. I would expect the result definitely being marked as UTC. -- type: enhancement -

[issue23332] datetime.isoformat() -> explicitly mark UTC string as such

2015-01-27 Thread Mirko Vogt
Mirko Vogt added the comment: I never said there is no way to result in an ISO 8601 string with UTC stated explicitly. I showed a case where I think it is correct to assume UTC is stated ( e.g. utcnow()), however the result of isoformat() doesn't

[issue23332] datetime.isoformat() -> explicitly mark UTC string as such

2015-01-27 Thread Mirko Vogt
Mirko Vogt added the comment: I got that - so marking utcnow() as deprecated seems like a good idea. But it's not just about utcnow() but also now(). now() also doesn't return any timezone stated by default - which I would still consider as a bug. However making now() require

[issue23332] datetime.isoformat() -> explicitly mark UTC string as such

2015-01-27 Thread Mirko Vogt
Mirko Vogt added the comment: Just to clarify my problem - then I'll just happily use datetime.now(tzutc()).isoformat() - There is datetime.now() which is supposed to be used (no utcnow() anymore) - datetime.now() might return a naive object, when no TZ is specified - *However* als

[issue23332] datetime.isoformat() -> explicitly mark UTC string as such

2015-02-27 Thread Mirko Vogt
Mirko Vogt added the comment: The proper response to that comment probably is: It's called ISO8601 and not RFC8601. And unfortunately ISO stands for "International Standard". -- ___ Python tracker <http://bugs.pyt