Skip to content

Old timezones require second precision #67

@justin-schroeder

Description

@justin-schroeder

In the ye olde days, timezones were not standardized so the offset from GMT is basically the geographic position of the timezone in degrees/minutes.

So the timezone offset for America/Detroit in 1904 is -05:32.18333333333334, or 5 hours, 32 minutes, 11 seconds. Since timezone offsets (+-00:00) cannot represent seconds 0.1.1 rounds these offsets to the nearest minute. -0532.

However, this causes problems when performing bi-directional format/parse — if you parse a date at midnight in one of these timezones and then format it back you will lose 11 seconds of time and the date will actually be the day before at 11:49pm.

To solve this, we need to add a second or even milliseconds to our timezone format. Perhaps something like +-HH:mm:ss.SSS with the ss.SSS being optional should be supported.

Metadata

Metadata

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions