Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides quasi quoters for writing time literals.
First enable the QuasiQuotes
language extension, then you will be able to
write the the following:
>>>
[utcIso8601| 2048-12-01 |] :: UTCTime
2048-12-01 00:00:00 UTC
Unparseable dates will throw errors at compile time.
Zoned time quoters are not provided as the time library doesn't seem to do anything with "%Z".
- utcIso8601 :: QuasiQuoter
- utcIso8601ms :: QuasiQuoter
- timeZone :: QuasiQuoter
- data UTCTime :: * = UTCTime {
- utctDay :: Day
- utctDayTime :: DiffTime
- data TimeZone :: * = TimeZone {}
- utcFormat :: String -> QuasiQuoter
- timeZoneFormat :: String -> QuasiQuoter
ISO8601 UTC time QuasiQuoters
utcIso8601 :: QuasiQuoter Source #
ISO8601 date with seconds and optional "." with more precision
following to a UTCTime
.
Do not specify a timezone, the time should be UTC.
>>>
[utcIso8601| 2048-12-01 |] :: UTCTime
2048-12-01 00:00:00 UTC
utcIso8601ms :: QuasiQuoter Source #
ISO8601 date with seconds and optional "." with more precision
following to a UTCTime
.
Do not specify a timezone, the time should be UTC.
>>>
[utcIso8601ms| 2099-01-01T00:00:00.42324 |]
2099-01-01 00:00:00.42324 UTC
TimeZone QuasiQuoters
timeZone :: QuasiQuoter Source #
Timezones from a reference string, to a TimeZone
.
>>>
[timeZone| BST |] :: TimeZone
BST
Re-exports
This is the simplest representation of UTC. It consists of the day number, and a time offset from midnight. Note that if a day has a leap second added to it, it will have 86401 seconds.
UTCTime | |
|
A TimeZone is a whole number of minutes offset from UTC, together with a name and a "just for summer" flag.
TimeZone | |
|
Specify your own formats
utcFormat :: String -> QuasiQuoter Source #
timeZoneFormat :: String -> QuasiQuoter Source #