Skip to content

Added and skipped days due to timezone changes crossing the International Date Line #2495

@maxnikulin

Description

@maxnikulin

It is quite close to the #1315 (daysInMonth) issue, so discussion may be continued there.

If I understand it correctly, Gregorian calendar (iso8601) is in use in Samoa. However there was no December, 30 2011 due to change of time zone involved crossing the International Date Line

zdump -v Pacific/Apia
...
Pacific/Apia  Fri Dec 30 09:59:59 2011 UT = Thu Dec 29 23:59:59 2011 -10 isdst=1 gmtoff=-36000
Pacific/Apia  Fri Dec 30 10:00:00 2011 UT = Sat Dec 31 00:00:00 2011 +14 isdst=1 gmtoff=50400
...

Does it mean that local calendar still should be provided to make "How many days until a future date" (cookbook) example working correctly?

Moreover the same timezone and Pacific/Samoa (not separated that time) had July,4 1892 twice due to crossing the International Date Line toward America:

zdump -v Pacific/Samoa
...
Pacific/Samoa  Mon Jul  4 11:22:47 1892 UT = Mon Jul  4 23:59:59 1892 LMT isdst=0 gmtoff=45432
Pacific/Samoa  Mon Jul  4 11:22:48 1892 UT = Mon Jul  4 00:00:00 1892 LMT isdst=0 gmtoff=-40968
...

To handle such case zonedDateTime.withPlainDate (and perhaps some other methods) may need disambiguation option similar to Temporal.ZonedDateTime.from.

I do not mind that local calendar should be defined to handle February, 30 in 1720 when they need an extra day to return to Julian calendar. From my point of view the case of Samoa is more subtle since formally standard calendar is used.

Metadata

Metadata

Assignees

Labels

documentationAdditions to documentationno-spec-textPR can be ignored by implementors

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions