timeparsers-0.3.1: Attoparsec parsers for various Date/Time formats.

Data.Time.Parsers.Types

Synopsis

Documentation

class ToZonedTime a whereSource

A type that can be converted to ZonedTime For LocalTime, it is assumed the TimeZone is UTC For Day, it is assumed that the TimeOfDay is midnight and the TimeZone is UTC

data DateFormat Source

Formats for purely numeric dates, e.g. 99-2-27

Constructors

YMD

year-month-day

MDY

month-year-day

DMY

day-month-year

data Flag Source

Flags to tune the behavior of a parser

Constructors

MakeRecent

Interpret years 0-99 as 1970-2069

DefaultToMidnight

If no TimeOfDay is supplied for a type where it is required, use midnight

DefaultToUTC

If no timezone is supplied for a type where it is required, use UTC

RequirePosixUnit

Require an s at the end of a POSIX timestamp. Can be used to distinguish between POSIXTime and iso8601 with no separators.

AustralianTimeZones

Use Australian Timezones

Instances

data Options Source

Constructors

Options 

Fields

formats :: [DateFormat]

List of what DateFormats to try.

seps :: String

Set of accepted separators

flags :: Set Flag

Set of Flags

type OptionedParser a = ReaderT Options Parser aSource

A Parser with Options

data DateToken Source

Constructors

Year Integer

An Integer that is known to represent a year

Month Integer

An Integer that is known to represent a month

Any Integer

An Integer that could represent a day, month, or year

data ExtendedTimestamp a Source

Constructors

Timestamp a

An explicit Timestamp

Now

The current time

Yesterday

Midnight yesterday

Today

Midnight today

Tomorrow

Midight tomorrow

Instances