tztime-0.1.1.0: Safe timezone-aware handling of time.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Time.TZTime.QQ

Synopsis

Documentation

tz :: QuasiQuoter Source #

Quasiquoter for parsing a TZTime at compile-time in the format: yyyy-mm-dd hh:mm:ss[.sss] [±hh:mm] [time zone].

The offset is optional, except when the local time is ambiguous (i.e. when the clocks are set back around that time in that time zone).

The offset can also be expressed using military time zone abbreviations, and these time zones abbreviations as per RFC 822 section 5: "UTC", "UT", "GMT", "EST", "EDT", "CST", "CDT", "MST", "MDT", "PST", "PDT".

Note: the time zone's rules are loaded from the embedded database using fromIdentifier.

>>> [tz|2022-03-04 10:15:40.123 [Europe/Rome]|]
2022-03-04 10:15:40.123 +01:00 [Europe/Rome]
>>> [tz|2022-11-06 01:30:00 [America/Winnipeg]|]
...
    • Ambiguous time: please specify an offset.
      Did you mean any of the following?
      - 2022-11-06 01:30:00 -05:00 [America/Winnipeg]
      - 2022-11-06 01:30:00 -06:00 [America/Winnipeg]
...