| Safe Haskell | None |
|---|
Data.Dates.Formats
Description
This module allows to parse arbitrary date formats. Date formats are specified as strings:
- 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 aSource
formatParser :: Stream s m Char => Format -> ParsecT s st m DateTimeSource
Make Parser for specified date format.