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.
One of the potential use cases for
TimeZoneSeriesis 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 toZonedTimeand then toLocalTimewill produce overlaps. This entails thatlocalTimeToUTC'has more than one candidateUTCTimefor aLocalTimeinside the overlap. Moreover, someLocalTimevalues should actually be illegal for a DST/non-DSTTimeZoneSeriesobject, because clocks jump forward. By the use oflistToMaybeinsidelocalTimeToUTC'the function currently disregards any extra candidates and by the use offromMaybeit accepts illegal time stamps.So either the return type of
localTimeToUTC'is changed to[UTCTime]or we provide heuristics to guess the correctTimeZonefrom context. I actually implemented the latter, but haven't published yet. The use case is series ofLocalTimestamps that are known to be ascending inUTCTimeand belong to a knownTimeZoneSeries. 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.