time-1.14: A time library
Safe HaskellSafe
LanguageHaskell2010

Data.Time.Format.ISO8601

Synopsis

Format

data Format t Source #

A text format for a type

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 CalendarDiffDays Source #

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

Instance details

Defined in Data.Time.Format.ISO8601

ISO8601 Day Source #

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

Instance details

Defined in Data.Time.Format.ISO8601

ISO8601 UTCTime Source #

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

Instance details

Defined in Data.Time.Format.ISO8601

ISO8601 CalendarDiffTime Source #

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

Instance details

Defined in Data.Time.Format.ISO8601

ISO8601 LocalTime Source #

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

Instance details

Defined in Data.Time.Format.ISO8601

ISO8601 TimeOfDay Source #

hh:mm:ss[.ss] [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 Source #

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

Instance details

Defined in Data.Time.Format.ISO8601

ISO8601 ZonedTime Source #

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

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

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

BasicFormat

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

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

calendarFormat :: FormatExtension -> Format Day Source #

yyyy-mm-dd (extended), yyyymmdd (basic) [ISO 8601:2004(E) sec. 4.1.2.2]

yearMonthFormat :: Format (Integer, Int) Source #

yyyy-mm [ISO 8601:2004(E) sec. 4.1.2.3(a)]

yearFormat :: Format Integer Source #

yyyy [ISO 8601:2004(E) sec. 4.1.2.3(b)]

centuryFormat :: Format Integer Source #

yy [ISO 8601:2004(E) sec. 4.1.2.3(c)]

expandedCalendarFormat :: Int -> FormatExtension -> Format Day Source #

±yyyyy-mm-dd (extended), ±yyyyymmdd (basic) [ISO 8601:2004(E) sec. 4.1.2.4(a)]

expandedYearMonthFormat :: Int -> Format (Integer, Int) Source #

±yyyyy-mm [ISO 8601:2004(E) sec. 4.1.2.4(b)]

expandedYearFormat :: Int -> Format Integer Source #

±yyyyy [ISO 8601:2004(E) sec. 4.1.2.4(c)]

expandedCenturyFormat :: Int -> Format Integer Source #

±yyy [ISO 8601:2004(E) sec. 4.1.2.4(d)]

ordinalDateFormat :: FormatExtension -> Format Day Source #

yyyy-ddd (extended), yyyyddd (basic) [ISO 8601:2004(E) sec. 4.1.3.2]

expandedOrdinalDateFormat :: Int -> FormatExtension -> Format Day Source #

yyyyy-ddd (extended), yyyyyddd (basic) [ISO 8601:2004(E) sec. 4.1.3.3]

weekDateFormat :: FormatExtension -> Format Day Source #

yyyy-Www-D (extended), yyyyWwwd (basic) [ISO 8601:2004(E) sec. 4.1.4.2]

yearWeekFormat :: FormatExtension -> Format (Integer, Int) Source #

yyyy-Www (extended), yyyyWww (basic) [ISO 8601:2004(E) sec. 4.1.4.3]

expandedWeekDateFormat :: Int -> FormatExtension -> Format Day Source #

±yyyyy-Www-d (extended), ±yyyyyWwwD (basic) [ISO 8601:2004(E) sec. 4.1.4.4]

expandedYearWeekFormat :: Int -> FormatExtension -> Format (Integer, Int) Source #

±yyyyy-Www (extended), ±yyyyyWww (basic) [ISO 8601:2004(E) sec. 4.1.4.4]

timeOfDayFormat :: FormatExtension -> Format TimeOfDay Source #

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

hourMinuteFormat :: FormatExtension -> Format TimeOfDay Source #

hh:mm[.mm] (extended), hhmm[.mm] (basic) [ISO 8601:2004(E) sec. 4.2.2.3(a), 4.2.2.4(b)]

hourFormat :: Format TimeOfDay Source #

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

withTimeDesignator :: Format t -> Format t Source #

Tx [ISO 8601:2004(E) sec. 4.2.2.5]

withUTCDesignator :: Format t -> Format t Source #

xZ [ISO 8601:2004(E) sec. 4.2.4]

timeOffsetFormat :: FormatExtension -> Format TimeZone Source #

±hh:mm (extended), ±hhmm (basic) [ISO 8601:2004(E) sec. 4.2.5.1]

timeOfDayAndOffsetFormat :: FormatExtension -> Format (TimeOfDay, TimeZone) Source #

hh:mm:ss±hh:mm (extended), hhmmss±hhmm (basic) [ISO 8601:2004(E) sec. 4.2.5.2]

localTimeFormat :: Format Day -> Format TimeOfDay -> Format LocalTime Source #

xTy [ISO 8601:2004(E) sec. 4.3.2]

zonedTimeFormat :: Format Day -> Format TimeOfDay -> FormatExtension -> Format ZonedTime Source #

xTy±hh:mm (extended), xTy±hhmm (basic) [ISO 8601:2004(E) sec. 4.3.2]

utcTimeFormat :: Format Day -> Format TimeOfDay -> Format UTCTime Source #

xTyZ [ISO 8601:2004(E) sec. 4.3.2]

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

xTy [ISO 8601:2004(E) sec. 4.3.3]

timeAndOffsetFormat :: Format t -> FormatExtension -> Format (t, TimeZone) Source #

x±hh:mm (extended), x±hhmm (basic) [ISO 8601:2004(E) sec. 4.3.3]

durationDaysFormat :: Format CalendarDiffDays Source #

PyyYmmMddD [ISO 8601:2004(E) sec. 4.4.3.2]

durationTimeFormat :: Format CalendarDiffTime Source #

PyyYmmMddDThhHmmMss[.ss]S [ISO 8601:2004(E) sec. 4.4.3.2]

alternativeDurationDaysFormat :: FormatExtension -> Format CalendarDiffDays Source #

Pyyyy-mm-dd (extended), Pyyyymmdd (basic) [ISO 8601:2004(E) sec. 4.4.3.3]

alternativeDurationTimeFormat :: FormatExtension -> Format CalendarDiffTime Source #

Pyyyy-mm-ddThh:mm:ss (extended), PyyyymmddThhmmss (basic) [ISO 8601:2004(E) sec. 4.4.3.3]

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

x/y [ISO 8601:2004(E) sec. 4.4.4.1]

recurringIntervalFormat :: Format a -> Format b -> Format (Int, a, b) Source #

Rn/x/y [ISO 8601:2004(E) sec. 4.5]

Other

isoMakeTimeOfDayValid :: Int -> Int -> Pico -> Maybe TimeOfDay Source #

Like makeTimeOfDayValid, but accepts 24 0 0 per ISO 8601:2004(E) sec. 4.2.3

Since: 1.12

Orphan instances