zoneinfo-0.2: ZoneInfo library.

Data.Time.ZoneInfo

Description

Provides access to the Olson zone-info database, using an adapted version of the Olson zone-info library.

Synopsis

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.

utcZoneInfo :: ZoneInfoSource

ZoneInfo for the UTC time-zone.

newZoneInfo :: String -> IO ZoneInfoSource

Create new ZoneInfo, given a suitable Olson identifier or time-zone specification. If the zone-info database cannot be found, or the time-zone not recognised, then an IOError will be thrown.

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.

localToUTCZoned :: ZoneInfo -> LocalTime -> IO (UTCTime, ZonedTime)Source

Convert LocalTime to a daylight saving adjusted pair.

convertTimeZone :: ZoneInfo -> LocalTime -> ZoneInfo -> IO ZonedTimeSource

Convert the LocalTime argument from the source to destination TimeZone.