tz-0.1.1.0: Efficient time zone handling

Copyright(C) 2014 Mihaly Barasz
LicenseApache-2.0, see LICENSE
MaintainerMihaly Barasz <klao@nilcons.com>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

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)

Synopsis

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.

includeTZFromFile :: FilePath -> Q Exp Source

Generate a TZ definition from the given time zone information file.