| Stability | experimental |
|---|---|
| Maintainer | Mihaly Barasz <[email protected]> |
| Safe Haskell | None |
Data.Time.Zones.TH
Description
Example usage:
{-# LANGUAGE TemplateHaskell #-}
import Data.Time
import Data.Time.Zones
import Data.Time.Zones.TH
tzBudapest :: TZ
tzBudapest = $(includeTZFromDB "Europe/Budapest")
tzLosAngeles :: TZ
tzLosAngeles = $(includeTZFromDB "America/Los_Angeles")
main :: IO ()
main = do
t <- getCurrentTime
putStrLn $ "Time in Budapest: " ++ show (utcToLocalTimeTZ tzBudapest t)
putStrLn $ "Time in Los Angeles: " ++ show (utcToLocalTimeTZ tzLosAngeles t)
- includeTZFromDB :: String -> Q Exp
- includeSystemTZ :: String -> Q Exp
- includeTZFromFile :: FilePath -> Q Exp
Documentation
includeTZFromDB :: String -> Q ExpSource
Generate a TZ definition from an entry out of the time zone
database shipped with this package.
includeSystemTZ :: String -> Q ExpSource
Generate a TZ definition from a system time zone information file.
See also: loadSystemTZ for details on how system time zone files
are located.
includeTZFromFile :: FilePath -> Q ExpSource
Generate a TZ definition from the given time zone information file.