Bug 15655 – SysTime.from*String incorrectly accept single digit time zones and minutes > 59
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-02-08T04:33:00Z
Last change time
2016-03-10T17:02:12Z
Assigned to
nobody
Creator
issues.dlang
Comments
Comment #0 by issues.dlang — 2016-02-08T04:33:58Z
"+08" and "-08" would be valid for a time zone per ISO 8601, as should be "+08:00" and "-08:00" for the extended format and "+0800" and "-0800" for the non-extdended format. However, strings like "+8" or "-8" are not legal. It must be +hhmm, -hhmm, +hh, or -hh for non-extended and +hh:mm, -hh:mm, +hh, or -hh for extended. And currently, SysTime.from*String is not properly strict about the time zone, allowing +h and -h when there are no minutes (even though it is properly strict when there are minutes) and is not strict about the number of digits in the minutes. In addition, it is not strict about whether the number of minutes is actually valid (e.g. "+07:60" should not be valid).
Comment #1 by github-bugzilla — 2016-03-10T17:02:12Z