json-time-0.1.0.0: json + time
Safe HaskellNone
LanguageHaskell2010

Codec.JSON.Decoder.Time

Description

Functions for decoding common time formats in RFC 8259 JSONs.

Synopsis

Calendar

year :: Decoder Year Source #

Decode a JSON string as an RFC 3339 year, in the yyyy format.

quarter :: Decoder Quarter Source #

Decode a JSON string as a quarter, in the yyyy-Qqq format.

Note that year quarters are not defined by ISO 8601, this is an informal convention.

Month

month :: Decoder Month Source #

Decode a JSON string as an RFC 3339 month, in the yyyy-mm format.

monthDate :: Decoder Day Source #

Decode a JSON string as an RFC 3339 month date, in the yyyy-mm-dd format.

Week

weekDate :: Decoder Day Source #

Decode a JSON string as an ISO 8601 week date, in the yyyy-Www-d format.

Ordinal

ordinalDate :: Decoder Day Source #

Decode a JSON string as an ISO 8601 ordinal date, in the yyyy-ddd format.

Time of day

timeOfDay :: Decoder TimeOfDay Source #

Decode a JSON string as an RFC 3339 time of day, in the hh:mm:ss[.s…] format.

Local

localTime :: Decoder LocalTime Source #

Decode a JSON string as an RFC 3339 local time, in the yyyy-mm-ddThh:mm:ss[.s…] format.

Either t or space is accepted instead of T.

Zoned

timeZone :: Decoder TimeZone Source #

Decode a JSON string as an RFC 3339 time zone, in either Z or ±hh:mm format.

z is accepted instead of Z.

zonedTime :: Decoder ZonedTime Source #

Decode a JSON string as an RFC 3339 zoned time, in the yyyy-mm-ddThh:mm:ss[.s…]±hh:mm format.

Combines behaviors of both timeOfDay and zonedTime.