Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Builder.Lathe.Time
Description
Functions for encoding data using common time formats.
Synopsis
- year :: Year -> Builder
- quarter :: Quarter -> Builder
- month :: Month -> Builder
- monthDate :: Day -> Builder
- weekDate :: Day -> Builder
- ordinalDate :: Day -> Builder
- timeOfDay :: TimeOfDay -> Builder
- localTime :: LocalTime -> Builder
- utcTime :: UTCTime -> Builder
- timeZone :: TimeZone -> Builder
- zonedTime :: ZonedTime -> Builder
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.