Copyright | (c) 2015 Bryan O'Sullivan 2015 Oleg Grenrus |
---|---|

License | BSD3 |

Maintainer | Oleg Grenrus <oleg.grenrus@iki.fi> |

Safe Haskell | None |

Language | Haskell2010 |

Parsers for parsing dates and times.

- day :: DateParsing m => m Day
- month :: DateParsing m => m (Integer, Int)
- localTime :: DateParsing m => m LocalTime
- timeOfDay :: DateParsing m => m TimeOfDay
- timeZone :: DateParsing m => m (Maybe TimeZone)
- utcTime :: DateParsing m => m UTCTime
- zonedTime :: DateParsing m => m ZonedTime
- type DateParsing m = (CharParsing m, LookAheadParsing m, Monad m)

# Documentation

day :: DateParsing m => m Day Source #

Parse a date of the form `YYYY-MM-DD`

.

localTime :: DateParsing m => m LocalTime Source #

Parse a date and time, of the form `YYYY-MM-DD HH:MM:SS`

.
The space may be replaced with a `T`

. The number of seconds may be
followed by a fractional component.

timeOfDay :: DateParsing m => m TimeOfDay Source #

Parse a time of the form `HH:MM:SS[.SSS]`

.

timeZone :: DateParsing m => m (Maybe TimeZone) Source #

Parse a time zone, and return `Nothing`

if the offset from UTC is
zero. (This makes some speedups possible.)

utcTime :: DateParsing m => m UTCTime Source #

Behaves as `zonedTime`

, but converts any time zone offset into a
UTC time.

zonedTime :: DateParsing m => m ZonedTime Source #

Parse a date with time zone info. Acceptable formats:

YYYY-MM-DD HH:MM:SS Z

The first space may instead be a `T`

, and the second space is
optional. The `Z`

represents UTC. The `Z`

may be replaced with a
time zone offset of the form `+0000`

or `-08:00`

, where the first
two digits are hours, the `:`

is optional and the second two digits
(also optional) are minutes.

type DateParsing m = (CharParsing m, LookAheadParsing m, Monad m) Source #