zoneinfo-0.4: 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 Olson = ForeignPtr COlsonSource

class ZoneInfo a whereSource

Methods

zoneInfoName :: a -> Bool -> IO StringSource

Returns the zone-name for either the standard or daylight saving zone, depending on the isdst boolean argument; an IOError will be thrown if this information is unavailable.

zoneInfoMinutes :: a -> Bool -> IO IntSource

Returns the UTC offset for either the standard or daylight saving zone, depending on the isdst boolean argument; an IOError will be thrown if this information is unavailable.

posixToZonedTime :: a -> POSIXTime -> IO ZonedTimeSource

Convert from POSIXTime to zoned LocalTime.

utcToZonedTime' :: a -> UTCTime -> IO ZonedTimeSource

Convert from UTCTime to zoned LocalTime.

localToPOSIXZoned :: a -> LocalTime -> IO (POSIXTime, TimeZone)Source

Convert LocalTime to a daylight saving adjusted pair.

localToUTCZoned :: a -> LocalTime -> IO (UTCTime, TimeZone)Source

Convert LocalTime to a daylight saving adjusted pair.

convertTimeZone :: ZoneInfo b => a -> LocalTime -> b -> IO ZonedTimeSource

Convert the LocalTime argument from the source to destination TimeZone.

Instances

ZoneInfo TimeZone

TimeZone implementation.

ZoneInfo OlsonZone

OlsonZone implementation.

newOlson :: Maybe String -> IO OlsonSource

Create an Olson context object. 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.

newOlsonZone :: Olson -> String -> IO OlsonZoneSource

Obtain an OlsonZone object based on the specified Olson identifier or time-zone. If the zone-info database cannot be found, or the time-zone not recognised, then an IOError will be thrown. Calls to this function for a given Olson object must be serialised across threads.

utcOlsonZone :: Olson -> OlsonZoneSource

OlsonZone for the UTC time-zone.