Skip to content

Deciding on Interface #2

@quinnj

Description

@quinnj

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 ZonedDateTime type: it would basically wrap a DateTime and probably some kind of TimeZone type that held the offset/DST/abbreviation information; through show the DateTime (which would be UTC) and the TimeZone info 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 output format function for displaying DateTime according 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions