lathe-time-0.1.0.0: lathe + time
Safe HaskellSafe-Inferred
LanguageHaskell2010

Builder.Lathe.Time

Description

Functions for encoding data using common time formats.

Synopsis

Calendar

year :: Year -> Builder Source #

Encode a year in ISO 8601 extended [-…y]yyyy format. At least 4 bytes wide.

Compatible with RFC 3339 if the year is in the \([0,10000)\) interval.

quarter :: Quarter -> Builder Source #

Encode a year quarter in [-…y]yyyy-Qq format. At least 7 bytes wide.

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

Month

month :: Month -> Builder Source #

Encode a month in ISO 8601 extended [-…y]yyyy-mm format. At least 7 bytes wide.

RFC 3339 compatibility matches that of the year function.

monthDate :: Day -> Builder Source #

Encode a month date in ISO 8601 extended [-…y]yyyy-mm-dd format. At least 10 bytes wide.

RFC 3339 compatibility matches that of the year function.

Week

weekDate :: Day -> Builder Source #

Encode a week date in ISO 8601 extended [-…y]yyyy-Www-d format. At least 10 bytes wide.

Ordinal

ordinalDate :: Day -> Builder Source #

Encode an ordinal date in ISO 8601 extended [-…y]yyyy-ddd format. At least 8 bytes wide.

Time of day

timeOfDay :: TimeOfDay -> Builder Source #

Encode a time of day in RFC 3339 hh:mm:ss[.s…] format. 8 to 21 bytes wide.

Local

localTime :: LocalTime -> Builder Source #

Encode a local time in ISO 8601 extended [-…y]yyyy-mm-ddThh:mm:ss[.s…] format. At least 19 bytes wide.

RFC 3339 compatibility matches that of the year function.

Zoned

utcTime :: UTCTime -> Builder Source #

Encode a UTC time in ISO 8601 extended [-…y]yyyy-mm-ddThh:mm:ss[.s…]Z format. At least 20 bytes wide.

RFC 3339 compatibility matches that of the year function.

timeZone :: TimeZone -> Builder Source #

Encode a time zone in ISO 8601 extended ±[…h]hh:mm format. At least 6 bytes wide.

Compatible with RFC 3339 if the minute offset from UTC is in the \((-24 \cdot 60, 24 \cdot 60)\) interval.

zonedTime :: ZonedTime -> Builder Source #

Encode a zoned time in ISO 8601 extended [-…y]yyyy-mm-ddThh:mm:ss[.s…]±[…h]hh:mm format. At least 25 bytes wide.

RFC 3339 compatibility matches that of both the year and timeZone functions.