Copyright | (C) 2014 Mihaly Barasz |
---|---|
License | Apache-2.0, see LICENSE |
Maintainer | Mihaly Barasz <klao@nilcons.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
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 Exp Source #
Generate a TZ
definition from an entry out of the time zone
database shipped with this package.
includeSystemTZ :: String -> Q Exp Source #
Generate a TZ
definition from a system time zone information file.
See also: loadSystemTZ
for details on how system time zone files
are located.