| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Data.Dates.Formats
Description
This module allows to parse arbitrary date formats. Date formats are specified as strings:
- DD.MM.YYY
- "YYYY/MM/DD"
- "DD/MM/YYYY, HH:mm:SS"
- "YY.MM.DD[, HH:mm:SS]"
- and so on.
- data FormatElement
- type Format = [FormatElement]
- type FormatParser a = Parsec String Bool a
- parseFormat :: String -> Either ParseError Format
- pFormat :: FormatParser Format
- formatParser :: Stream s m Char => Format -> ParsecT s st m DateTime
- parseDateFormat :: String -> String -> Either ParseError DateTime
Documentation
data FormatElement Source
Date/time format element
Constructors
| YEAR Bool Int | |
| MONTH Bool Int | |
| DAY Bool Int | |
| HOUR Bool Int | |
| MINUTE Bool Int | |
| SECOND Bool Int | |
| Whitespace Bool | |
| Fixed Bool String |
Instances
type Format = [FormatElement] Source
Date/time format
type FormatParser a = Parsec String Bool a Source
formatParser :: Stream s m Char => Format -> ParsecT s st m DateTime Source
Make Parser for specified date format.
Parse date/time in specified format.