zoneinfo-0.5: ZoneInfo library.Source codeContentsIndex
Data.Time.ZoneInfo
Description
Provides access to the Olson zone-info database, using an adapted version
Synopsis
type Context = ForeignPtr CContext
class ZoneInfo a where
zoneInfoName :: a -> Bool -> IO String
zoneInfoMinutes :: a -> Bool -> IO Int
posixToZonedTime :: a -> POSIXTime -> IO ZonedTime
utcToZonedTime' :: a -> UTCTime -> IO ZonedTime
localToPOSIXZoned :: a -> LocalTime -> IO (POSIXTime, TimeZone)
localToUTCZoned :: a -> LocalTime -> IO (UTCTime, TimeZone)
convertTimeZone :: ZoneInfo b => a -> LocalTime -> b -> IO ZonedTime
newContext :: Maybe String -> IO Context
newOlsonZone :: Context -> String -> IO OlsonZone
utcOlsonZone :: Context -> OlsonZone
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.
show/hide Instances
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.
Produced by Haddock version 2.6.0