Copyright | Plow Technologies LLC |
---|---|
License | MIT License |
Maintainer | Scott Murphy |
Safe Haskell | None |
Language | Haskell2010 |
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
- data HerfZonedTime (z :: Symbol)
- toZonedTime :: forall z. KnownSymbol z => UTCTime -> HerfZonedTime z
- fromZonedTime :: forall z. KnownSymbol z => HerfZonedTime z -> UTCTime
- addTimeZone :: forall z. KnownSymbol z => UTCTime -> HerfZonedTime z
- herfz :: ZonedTime -> UTCHerfTime
- reherfz :: FromUTCHerfTime b => ZonedTime -> b
- module HerfTime
- module Data.Time
Documentation
data HerfZonedTime (z :: Symbol) Source #
Zoned Time always has an extra parameter to convert into a fixed time
Instances
toZonedTime :: forall z. KnownSymbol z => UTCTime -> HerfZonedTime z Source #
Helper function to convert UTCTime to HerfZoned time
fromZonedTime :: forall z. KnownSymbol z => HerfZonedTime z -> UTCTime Source #
Getting back from HerfZonedTime to UTCTime
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
reherfz :: FromUTCHerfTime b => ZonedTime -> b Source #
like reherf
but for zoned time (which doesn't have a direct HerfedTime instance)
module HerfTime
module Data.Time