-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Description
As people actually need this package now, I figure it's time to figure out a good interface. I'll list a few options off the top of my head, mainly ideas that have come up in various discussions (when we merged Dates.jl into Base, an old issue or two in the Dates.jl repo, etc.).
- Full on
ZonedDateTimetype: it would basically wrap aDateTimeand probably some kind ofTimeZonetype that held the offset/DST/abbreviation information; throughshowtheDateTime(which would be UTC) and theTimeZoneinfo would be combined to show the offsetted datetime. - At one point, it occurred to me that dealing with timezones is almost purely an IO issue. Sometimes you get timezoned datetimes that you need to read in and convert to UTC. Other times you have UTC datetimes and you need to output the datetime according to a certain timezone. With this interface, there is no "aggregate type", just IO functions around timezones (parsing timezoned datetimes, converting
DateTimes between timezones, and an outputformatfunction for displayingDateTimeaccording to a timezone). I personally feel like, while different from most other implementations, this is a very good way to think/work with timezones. It forces the user to immediately get their data into UTC (since that's the only "type"), so data is stored/processed/calculated all in UTC which has very clear, sensible calculation rules. It still allows, however, one to work with timezones by parsing and outputting.
Metadata
Metadata
Assignees
Labels
No labels