Bug 15339 – std.datetime: document DST handling

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2015-11-15T07:03:09Z
Last change time
2024-12-01T16:25:21Z
Assigned to
Neia Neutuladh
Creator
Neia Neutuladh
Moved to GitHub: phobos#9667 →

Comments

Comment #0 by dhasenan — 2015-11-15T07:03:09Z
DateTime (specifically TimeOfDay) contains validation to ensure that its hour is never above 23. This means that it is intended to represent time shown on a typical clock (and not, for instance, the nth hour of the day). This should be documented. When daylight saving time starts and ends, there is a day with fewer or more than 24 hours. In the US, the hour of 2am is repeated or omitted as appropriate. This results in ambiguous dates. This should be documented. Since `SysTime(DateTime(2015, 11, 1, 1, 0, 0), TimeZone.getTimeZone("America/Los Angeles")).add!"hours"(1)` returns 2015-11-01T01:00:00, it should further be documented (after verification) that the date chosen is the earlier of applicable dates. It should further be clarified that `SysTime(DateTime(2015, 11, 1, 1, 0, 0), TimeZone.getTimeZone("America/Los Angeles")).add!"hours"(1).add!"hours"(1)` does in fact yield 2015-11-01T02:00:00, as you would expect. Finally, we should add unittests to ensure we don't break this behavior.
Comment #1 by robert.schadek — 2024-12-01T16:25:21Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9667 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB