zoneinfo-0.5: ZoneInfo library.

Data.Time.ZoneInfo

Description

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

Synopsis

Documentation

type Context = ForeignPtr CContextSource

Library context.

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.

newContext :: Maybe String -> IO ContextSource

Create a 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 :: Context -> 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 Context must be serialised across threads.

utcOlsonZone :: Context -> OlsonZoneSource

OlsonZone for the UTC time-zone.