|Maintainer||Mihaly Barasz <firstname.lastname@example.org>|
- data TZ
- utcTZ :: TZ
- diffForPOSIX :: TZ -> Int64 -> Int
- timeZoneForPOSIX :: TZ -> Int64 -> TimeZone
- timeZoneForUTCTime :: TZ -> UTCTime -> TimeZone
- utcToLocalTimeTZ :: TZ -> UTCTime -> LocalTime
- data LocalToUTCResult
- localTimeToUTCFull :: TZ -> LocalTime -> LocalToUTCResult
- localTimeToUTCTZ :: TZ -> LocalTime -> UTCTime
- data FromLocal
- localToPOSIX :: TZ -> Int64 -> FromLocal
- loadTZFromFile :: FilePath -> IO TZ
- loadTZFromDB :: String -> IO TZ
- loadSystemTZ :: String -> IO TZ
- loadLocalTZ :: IO TZ
Universal -> Local direction
Returns the time difference (in seconds) for TZ at the given POSIX time.
Local -> Universal direction
Fully descriptive result of a LocalTime to UTCTime conversion.
In case of LTUAmbiguous the first result is always earlier than the second one. Generally this only happens during the daylight saving -> standard time transition (ie. summer -> winter). So, the first result corresponds to interpreting the LocalTime as a daylight saving time and the second result as standard time in the given location.
But, if the location had some kind of administrative time
transition during which the clocks jumped back, then both results
can correspond to standard times (or daylight saving times) just
before and after the transition. You can always inspect the
timeZoneSummerOnly field of the returned
TimeZones to get an
idea what kind of transition was taking place.
TODO(klao): document the LTUNone behavior.
Internal representation of LocalTime -> UTCTime conversion result:
Reads and parses a time zone information file (in
aka. Olson file format) and returns the corresponding TZ data
Reads the corresponding file from the time zone database shipped with this package.
Looks for the time zone file in the system timezone directory, which is
/usr/share/zoneinfo, or if the
TZDIR environment variable is
set, then there.
Returns the local
TZ based on the
tzset(3) for details, but basically:
TZenvironment variable is unset, we
TZis set, but empty, we
- Otherwise, we just
Note, this means we don't support POSIX-style
TZ variables (like
"EST5EDT"), only those that are explicitly present in the time