Bug 15654 – SysTime.toISOString formats the time zones incorrectly

Status
REOPENED
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-02-08T03:02:15Z
Last change time
2024-12-01T16:25:59Z
Assigned to
No Owner
Creator
Jonathan M Davis
Moved to GitHub: phobos#9674 →

Comments

Comment #0 by issues.dlang — 2016-02-08T03:02:15Z
The ISO Extended format for time zones other than UTC is +hh:mm, -hh:mm, +hh, or -hh. ISO non-Extended is the same but without the colons. However, currently SysTime uses colons for non-Extended (it correctly doesn't put the dashes or colons in the date or time portion, but it still puts the colons in the time zone portion). So, we need to fix it so that toISOString does not use colons in the time zone, and fromISOString should not accept them either, though I think that we're going to have to accept them for a while in case existing code has been writing them out with toISOString and saving them to later read in with fromISOString.
Comment #1 by github-bugzilla — 2016-03-10T17:02:10Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/7ded5fcf686c988c4d26869ac0e16a1fd0e5a446 Rename SimpleTimeZone.to/fromISOString to to/fromISOExtString. This is per issue# 15654. https://github.com/D-Programming-Language/phobos/commit/2567a2493a168343be6be3050cd4bef90b320f58 Fix issue# 15654: SysTime.toISOString formats time zones incorrectly. Previously, it formatted the time zone the same as toISOExtString and put a colon between the hours and minutes - which is correct for the ISO extended format, but not the non-extended format. Now, it formats it correctly per the ISO 9601 standard. fromISOString temporarily accepts both the extended and non-extended formats to avoid breaking any programs that have been writing out ISO strings to read back in later, but eventually, we'll make it so that it only accepts the non-extended format like it's supposed to.
Comment #2 by github-bugzilla — 2016-03-19T20:22:38Z
Commits pushed to stable at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/7ded5fcf686c988c4d26869ac0e16a1fd0e5a446 Rename SimpleTimeZone.to/fromISOString to to/fromISOExtString. https://github.com/D-Programming-Language/phobos/commit/2567a2493a168343be6be3050cd4bef90b320f58 Fix issue# 15654: SysTime.toISOString formats time zones incorrectly.
Comment #3 by issues.dlang — 2017-08-08T23:42:17Z
It looks like I screwed up and only fixed the fromISOString portion of this so that it accepted the correct type without actually fixing what was emitted.
Comment #4 by bugzilla — 2020-01-03T15:51:29Z
Could you provide an example? I'm currently not sure if this is fixed or still a bug or not an issue anymore, because when I use toISOString, no timezone is printed at all...
Comment #5 by robert.schadek — 2024-12-01T16:25:59Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9674 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB