time-compat-1.9.6.1: Compatibility package for time
Safe Haskell Trustworthy
Language Haskell2010

Data.Time.Format.ISO8601.Compat

Synopsis

Format

data Format t Source #

A text format for a type

Instances

Instances details
Productish Format
Instance details

Defined in Data.Format

Summish Format
Instance details

Defined in Data.Format

IsoVariant Format
Instance details

Defined in Data.Format

Methods

isoMap :: (a -> b) -> (b -> a) -> Format a -> Format b

formatShowM :: Format t -> t -> Maybe String Source #

Show a value in the format, if representable

formatShow :: Format t -> t -> String Source #

Show a value in the format, or error if unrepresentable

formatReadP :: Format t -> ReadP t Source #

Read a value in the format

formatParseM :: MonadFail m => Format t -> String -> m t Source #

Parse a value in the format

Common formats

class ISO8601 t where Source #

Methods

iso8601Format :: Format t Source #

The most commonly used ISO 8601 format for this type.

Instances

Instances details
ISO8601 ZonedTime

yyyy-mm-ddThh:mm:ss[.sss]±hh:mm (ISO 8601:2004(E) sec. 4.3.2 extended format)

Instance details

Defined in Data.Time.Format.ISO8601

ISO8601 LocalTime

yyyy-mm-ddThh:mm:ss[.sss] (ISO 8601:2004(E) sec. 4.3.2 extended format)

Instance details

Defined in Data.Time.Format.ISO8601

ISO8601 TimeOfDay

hh:mm:ss[.sss] (ISO 8601:2004(E) sec. 4.2.2.2, 4.2.2.4(a) extended format)

Instance details

Defined in Data.Time.Format.ISO8601

ISO8601 TimeZone

±hh:mm (ISO 8601:2004(E) sec. 4.2.5.1 extended format)

Instance details

Defined in Data.Time.Format.ISO8601

ISO8601 CalendarDiffTime

PyYmMdDThHmMs[.sss]S (ISO 8601:2004(E) sec. 4.4.3.2)

Instance details

Defined in Data.Time.Format.ISO8601

ISO8601 UTCTime

yyyy-mm-ddThh:mm:ss[.sss]Z (ISO 8601:2004(E) sec. 4.3.2 extended format)

Instance details

Defined in Data.Time.Format.ISO8601

ISO8601 Day

yyyy-mm-dd (ISO 8601:2004(E) sec. 4.1.2.2 extended format)

Instance details

Defined in Data.Time.Format.ISO8601

ISO8601 CalendarDiffDays

PyYmMdD (ISO 8601:2004(E) sec. 4.4.3.2)

Instance details

Defined in Data.Time.Format.ISO8601

iso8601Show :: ISO8601 t => t -> String Source #

Show in the most commonly used ISO 8601 format.

iso8601ParseM :: ( MonadFail m, ISO8601 t) => String -> m t Source #

Parse the most commonly used ISO 8601 format.

All formats

data FormatExtension Source #

Constructors

ExtendedFormat

ISO 8601:2004(E) sec. 2.3.4. Use hyphens and colons.

BasicFormat

ISO 8601:2004(E) sec. 2.3.3. Omit hyphens and colons. "The basic format should be avoided in plain text."

formatReadPExtension :: ( FormatExtension -> Format t) -> ReadP t Source #

Read a value in either extended or basic format

parseFormatExtension :: MonadFail m => ( FormatExtension -> Format t) -> String -> m t Source #

Parse a value in either extended or basic format

yearMonthFormat :: Format ( Integer , Int ) Source #

ISO 8601:2004(E) sec. 4.1.2.3(a)

yearFormat :: Format Integer Source #

ISO 8601:2004(E) sec. 4.1.2.3(b)

centuryFormat :: Format Integer Source #

ISO 8601:2004(E) sec. 4.1.2.3(c)

timeOfDayFormat :: FormatExtension -> Format TimeOfDay Source #

ISO 8601:2004(E) sec. 4.2.2.2, 4.2.2.4(a)

hourMinuteFormat :: FormatExtension -> Format TimeOfDay Source #

ISO 8601:2004(E) sec. 4.2.2.3(a), 4.2.2.4(b)

hourFormat :: Format TimeOfDay Source #

ISO 8601:2004(E) sec. 4.2.2.3(b), 4.2.2.4(c)

withTimeDesignator :: Format t -> Format t Source #

ISO 8601:2004(E) sec. 4.2.2.5

withUTCDesignator :: Format t -> Format t Source #

ISO 8601:2004(E) sec. 4.2.4

dayAndTimeFormat :: Format Day -> Format time -> Format ( Day , time) Source #

ISO 8601:2004(E) sec. 4.3.3

intervalFormat :: Format a -> Format b -> Format (a, b) Source #

ISO 8601:2004(E) sec. 4.4.4.1