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

Parser.Lathe.Time

Description

Functions for parsing common time formats.

Synopsis

Calendar

year Source #

Arguments

:: e

Malformed.

-> e

Reached end.

-> Parser e Year 

Consume four decimal digits that represent an RFC 3339 full year.

quarter Source #

Arguments

:: e

Out of bounds.

-> e

Malformed.

-> e

Reached end.

-> Parser e Quarter 

Consume 7 bytes that represent a year quarter, in the yyyy-Qq format.

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

Month

month Source #

Arguments

:: e

Out of bounds

-> e

Malformed.

-> e

Reached end.

-> Parser e Month 

Consume 7 bytes that represent an RFC 3339 month, in the yyyy-mm format.

monthDate Source #

Arguments

:: e

Out of bounds.

-> e

Malformed.

-> e

Reached end.

-> Parser e Day 

Consume 10 bytes that represent an RFC 3339 month date, in the yyyy-mm-dd format.

Week

weekDate Source #

Arguments

:: e

Out of bounds.

-> e

Malformed.

-> e

Reached end.

-> Parser e Day 

Consume 10 bytes that represent an ISO 8601 week date, in the extended yyyy-Www-d format.

Ordinal

ordinalDate Source #

Arguments

:: e

Out of bounds.

-> e

Malformed.

-> e

Reached end.

-> Parser e Day 

Consume 8 bytes that represent an ISO 8601 ordinal date, in the yyyy-ddd format.

Time of day

timeOfDay Source #

Arguments

:: e

Out of bounds.

-> e

Malformed.

-> e

Reached end.

-> Parser e TimeOfDay 

Consume at least 8 bytes that represent an RFC 3339 time of day, in the hh:mm:ss[.s…] format.

Local

localTime Source #

Arguments

:: e

Out of bounds.

-> e

Malformed.

-> e

Reached end.

-> Parser e LocalTime 

Consume at least 19 bytes that represent an RFC 3339 full time without time zone, in the yyyy-mm-ddThh:mm:ss[.s…] format.

Either t or space is accepted instead of T.

Zoned

timeZone Source #

Arguments

:: e

Out of bounds.

-> e

Malformed.

-> e

Reached end.

-> Parser e TimeZone 

Consume 1 or 6 bytes that represent an RFC 3339 time zone, in the Z and ±hh:mm formats respectively.

z is accepted instead of Z.

zonedTime Source #

Arguments

:: e

Out of bounds.

-> e

Malformed.

-> e

Reached end.

-> Parser e ZonedTime 

Consume at least 19 bytes that represent an RFC 3339 full time with a time zone.

Combines behaviors of both timeOfDay and timeZone.