Skip to content

TimeZoneSeries may produce overlapping LocalTime intervals #19

Description

@olafklinke

One of the potential use cases for TimeZoneSeries is daylight savings time (DST). (related to another issue: infinite lists of time zone changes?) While the UTC time intervals of DST and non-DST do not overlap, their mapping to ZonedTime and then to LocalTime will produce overlaps. This entails that localTimeToUTC' has more than one candidate UTCTime for a LocalTime inside the overlap. Moreover, some LocalTime values should actually be illegal for a DST/non-DST TimeZoneSeries object, because clocks jump forward. By the use of listToMaybe inside localTimeToUTC' the function currently disregards any extra candidates and by the use of fromMaybe it accepts illegal time stamps.

So either the return type of localTimeToUTC' is changed to [UTCTime] or we provide heuristics to guess the correct TimeZone from context. I actually implemented the latter, but haven't published yet. The use case is series of LocalTime stamps that are known to be ascending in UTCTime and belong to a known TimeZoneSeries. These are common. As a data scientist I deal with such time series every day. Question is whether handling of such series is within the scope of this package.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions