herf-time-0.2.0: haskell time manipulation in a 'kerf like' style.

CopyrightPlow Technologies LLC
LicenseMIT License
MaintainerScott Murphy
Safe HaskellNone
LanguageHaskell2010

HerfTime.ZonedTime

Description

The basic idea is to use the regular local time implementation available in the time library but with a few nice wrappers.

For HerfTime to work nicely the information about what makes a time different should reside in the type.

in the case of zoned time, this is the time zone:

HerfZonedTime knows about these time zones by name:

RFC 822 sec. 5: UT, GMT, EST, EDT, CST, CDT, MST, MDT, PST, PDT.

|

Synopsis

Documentation

data HerfZonedTime z Source #

Zoned Time always has an extra parameter to convert into a fixed time

Instances

KnownSymbol z => Show (HerfZonedTime z) Source # 
FormatTime (HerfZonedTime z) Source # 
ParseTime (HerfZonedTime z) Source # 
KnownSymbol z => HerfedTime (HerfZonedTime z) Source #
>>> :set -XDataKinds
>>> (reherf $ ( dateTime 2016 01 01 01 01 01 :: HerfZonedTime "CST")) :: HerfZonedTime "PST"
2015-12-31T23:01:01:PST
KnownSymbol z => FromUTCHerfTime (HerfZonedTime z) Source # 
KnownSymbol z => ToUTCHerfTime (HerfZonedTime z) Source # 

addTimeZone :: forall z. KnownSymbol z => UTCTime -> HerfZonedTime z Source #

Add Time Zone is different than converting It takes a UTCTime and just slaps on the timezone in the ZonedTime field This is exactly what you want when you are first creating a time and almost never what you want after!

herfz :: ZonedTime -> UTCHerfTime Source #

Don't want an orphan on ZonedTime so I made herfz