Provides access to the Olson zone-info database, using an adapted version of the Olson zone-info library.
- type ZoneInfo = ForeignPtr CZoneInfo
- initZoneInfo :: Maybe String -> IO ()
- utcZoneInfo :: ZoneInfo
- newZoneInfo :: String -> IO ZoneInfo
- getZoneName :: ZoneInfo -> Bool -> IO String
- getZoneMinutes :: ZoneInfo -> Bool -> IO Int
- posixToZonedTime :: ZoneInfo -> POSIXTime -> IO ZonedTime
- utcToZonedTime' :: ZoneInfo -> UTCTime -> IO ZonedTime
- localToPOSIXZoned :: ZoneInfo -> LocalTime -> IO (POSIXTime, ZonedTime)
- localToUTCZoned :: ZoneInfo -> LocalTime -> IO (UTCTime, ZonedTime)
- convertTimeZone :: ZoneInfo -> LocalTime -> ZoneInfo -> IO ZonedTime
Documentation
type ZoneInfo = ForeignPtr CZoneInfoSource
initZoneInfo :: Maybe String -> IO ()Source
Initialise the zone-info library. A path to the zone-info database may
be specified. Otherwise, the TZDIR environment variable, or a reasonable
default, will be used. An IOError
will be thrown on failure.
ZoneInfo
for the UTC time-zone.
newZoneInfo :: String -> IO ZoneInfoSource
getZoneName :: ZoneInfo -> Bool -> IO StringSource
Returns the zone-name for either the standard or daylight saving zone,
depending on the isdst
argument.
getZoneMinutes :: ZoneInfo -> Bool -> IO IntSource
Returns the UTC offset for either the standard or daylight saving zone,
depending on the isdst
argument.
localToPOSIXZoned :: ZoneInfo -> LocalTime -> IO (POSIXTime, ZonedTime)Source
Convert LocalTime
to a daylight saving adjusted pair.