ZonedDateTime's startOfDay
and hoursInDay
when the same date starts twice due to offset transition
#2938
Labels
documentation
Additions to documentation
Milestone
zdump -v -c 2010,2011 America/St_Johns
:In this time zone, the moment when
2010-11-06
ends and2010-11-07
starts occurred twice (before and after the offset transition).2010-11-06
: 24 hours (00:00:00-23:59:59.999, in offset-02:30
)2010-11-07
: 1 minute (00:00:00-00:00:59.999, in offset-02:30
)2010-11-06
again: 59 minutes (23:01:00-23:59:59.999, in offset-03:30
)2010-11-07
again: 24 hours (00:00:00-23:59:59.999, in offset-03:30
)According to tz database,
America/Goose_Bay
before 2010,America/Moncton
before 2006,Pacific/Guam
andPacific/Saipan
in 1969,America/Phoenix
in 1944 follows same pattern (offset transition backwards from 00:00:59 to 23:01:00). AlsoAntarctica/Casey
changed offset backwards in March 2010 (from 01:59:59 to 23:00:00), which causes same situation.current behavior is below:
In my opinion, unlike #2910 this behavior is appropriate and not a spec bug, because
startOfDay
method returns 'the earliest valid local clock time during the current calendar day' correctly ('the current calendar day' isn't continuous though), andhoursInDay
property behaves consistently (25 hours in the day when DST ends, which is same to common cases). But I'm not sure I'm correct.Also even if it's not a spec bug, it is the corner case the developer using these API should consider, so it would be great to document it (as a
Pacific/Apia
case inhoursInDay
docs).PS. Offset transitions in Alaska in 1867 due to the purchase of Alaska from Russia (west to east of the international date line, opposite to
Pacific/Apia
in 2011) is a corner case too, but it's historical events and would not so critical.The text was updated successfully, but these errors were encountered: