Data.Time.Format.ISO8601.Compat

time-compat-1.9.8: Compatibility package for time

Safe Haskell | Trustworthy
Language | Haskell2010

Data.Time.Format.ISO8601.Compat

Contents

- Format
- Common formats
- All formats

Synopsis

- data Format t
- formatShowM :: Format t -> t -> Maybe String
- formatShow :: Format t -> t -> String
- formatReadP :: Format t -> ReadP t
- formatParseM :: MonadFail m => Format t -> String -> m t
- class ISO8601 t where
  - iso8601Format :: Format t
- iso8601Show :: ISO8601 t => t -> String
- iso8601ParseM :: (MonadFail m, ISO8601 t) => String -> m t
- data FormatExtension
  - = ExtendedFormat
  - | BasicFormat
- formatReadPExtension :: (FormatExtension -> Format t) -> ReadP t
- parseFormatExtension :: MonadFail m => (FormatExtension -> Format t) -> String -> m t
- calendarFormat :: FormatExtension -> Format Day
- yearMonthFormat :: Format (Integer, Int)
- yearFormat :: Format Integer
- centuryFormat :: Format Integer
- expandedCalendarFormat :: Int -> FormatExtension -> Format Day
- expandedYearMonthFormat :: Int -> Format (Integer, Int)
- expandedYearFormat :: Int -> Format Integer
- expandedCenturyFormat :: Int -> Format Integer
- ordinalDateFormat :: FormatExtension -> Format Day
- expandedOrdinalDateFormat :: Int -> FormatExtension -> Format Day
- weekDateFormat :: FormatExtension -> Format Day
- yearWeekFormat :: FormatExtension -> Format (Integer, Int)
- expandedWeekDateFormat :: Int -> FormatExtension -> Format Day
- expandedYearWeekFormat :: Int -> FormatExtension -> Format (Integer, Int)
- timeOfDayFormat :: FormatExtension -> Format TimeOfDay
- hourMinuteFormat :: FormatExtension -> Format TimeOfDay
- hourFormat :: Format TimeOfDay
- withTimeDesignator :: Format t -> Format t
- withUTCDesignator :: Format t -> Format t
- timeOffsetFormat :: FormatExtension -> Format TimeZone
- timeOfDayAndOffsetFormat :: FormatExtension -> Format (TimeOfDay, TimeZone)
- localTimeFormat :: Format Day -> Format TimeOfDay -> Format LocalTime
- zonedTimeFormat :: Format Day -> Format TimeOfDay -> FormatExtension -> Format ZonedTime
- utcTimeFormat :: Format Day -> Format TimeOfDay -> Format UTCTime
- dayAndTimeFormat :: Format Day -> Format time -> Format (Day, time)
- timeAndOffsetFormat :: Format t -> FormatExtension -> Format (t, TimeZone)
- durationDaysFormat :: Format CalendarDiffDays
- durationTimeFormat :: Format CalendarDiffTime
- alternativeDurationDaysFormat :: FormatExtension -> Format CalendarDiffDays
- alternativeDurationTimeFormat :: FormatExtension -> Format CalendarDiffTime
- intervalFormat :: Format a -> Format b -> Format (a, b)
- recurringIntervalFormat :: Format a -> Format b -> Format (Int, a, b)

# Format

data Format t #

A text format for a type

#### Instances

Instances details

IsoVariant Format |
Instance details Defined in Data.Format Methods isoMap :: (a -> b) -> (b -> a) -> Format a -> Format b
Productish Format |
Instance details Defined in Data.Format Methods pUnit :: Format () (<**>) :: Format a -> Format b -> Format (a, b) (**>) :: Format () -> Format a -> Format a (<**) :: Format a -> Format () -> Format a
Summish Format |
Instance details Defined in Data.Format Methods pVoid :: Format Void (<++>) :: Format a -> Format b -> Format (Either a b)

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

Show a value in the format, if representable

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

Show a value in the format, or error if unrepresentable

formatReadP :: Format t -> ReadP t #

Read a value in the format

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

Parse a value in the format

# Common formats

class ISO8601 t where #

Methods

iso8601Format :: Format t #

The most commonly used ISO 8601 format for this type.

#### Instances

Instances details

ISO8601 CalendarDiffDays | `PyYmMdD` (ISO 8601:2004(E) sec. 4.4.3.2)
Instance details Defined in Data.Time.Format.ISO8601 Methods iso8601Format :: Format CalendarDiffDays #
ISO8601 Day | `yyyy-mm-dd` (ISO 8601:2004(E) sec. 4.1.2.2 extended format)
Instance details Defined in Data.Time.Format.ISO8601 Methods iso8601Format :: Format Day #
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 Methods iso8601Format :: Format UTCTime #
ISO8601 CalendarDiffTime | `PyYmMdDThHmMs[.sss]S` (ISO 8601:2004(E) sec. 4.4.3.2)
Instance details Defined in Data.Time.Format.ISO8601 Methods iso8601Format :: Format CalendarDiffTime #
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 Methods iso8601Format :: Format LocalTime #
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 Methods iso8601Format :: Format TimeOfDay #
ISO8601 TimeZone | `±hh:mm` (ISO 8601:2004(E) sec. 4.2.5.1 extended format)
Instance details Defined in Data.Time.Format.ISO8601 Methods iso8601Format :: Format TimeZone #
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 Methods iso8601Format :: Format ZonedTime #

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

Show in the most commonly used ISO 8601 format.

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

Parse the most commonly used ISO 8601 format.

# All formats

data FormatExtension #

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 #

Read a value in either extended or basic format

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

Parse a value in either extended or basic format

calendarFormat :: FormatExtension -> Format Day #

ISO 8601:2004(E) sec. 4.1.2.2

yearMonthFormat :: Format (Integer, Int) #

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

yearFormat :: Format Integer #

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

centuryFormat :: Format Integer #

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

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

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

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

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

expandedYearFormat :: Int -> Format Integer #

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

expandedCenturyFormat :: Int -> Format Integer #

ISO 8601:2004(E) sec. 4.1.2.4(d)

ordinalDateFormat :: FormatExtension -> Format Day #

ISO 8601:2004(E) sec. 4.1.3.2

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

ISO 8601:2004(E) sec. 4.1.3.3

weekDateFormat :: FormatExtension -> Format Day #

ISO 8601:2004(E) sec. 4.1.4.2

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

ISO 8601:2004(E) sec. 4.1.4.3

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

ISO 8601:2004(E) sec. 4.1.4.2

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

ISO 8601:2004(E) sec. 4.1.4.3

timeOfDayFormat :: FormatExtension -> Format TimeOfDay #

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

hourMinuteFormat :: FormatExtension -> Format TimeOfDay #

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

hourFormat :: Format TimeOfDay #

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

withTimeDesignator :: Format t -> Format t #

ISO 8601:2004(E) sec. 4.2.2.5

withUTCDesignator :: Format t -> Format t #

ISO 8601:2004(E) sec. 4.2.4

timeOffsetFormat :: FormatExtension -> Format TimeZone #

ISO 8601:2004(E) sec. 4.2.5.1

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

ISO 8601:2004(E) sec. 4.2.5.2

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

ISO 8601:2004(E) sec. 4.3.2

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

ISO 8601:2004(E) sec. 4.3.2

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

ISO 8601:2004(E) sec. 4.3.2

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

ISO 8601:2004(E) sec. 4.3.3

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

ISO 8601:2004(E) sec. 4.3.3

durationDaysFormat :: Format CalendarDiffDays #

ISO 8601:2004(E) sec. 4.4.3.2

durationTimeFormat :: Format CalendarDiffTime #

ISO 8601:2004(E) sec. 4.4.3.2

alternativeDurationDaysFormat :: FormatExtension -> Format CalendarDiffDays #

ISO 8601:2004(E) sec. 4.4.3.3

alternativeDurationTimeFormat :: FormatExtension -> Format CalendarDiffTime #

ISO 8601:2004(E) sec. 4.4.3.3

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

ISO 8601:2004(E) sec. 4.4.4.1

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

ISO 8601:2004(E) sec. 4.5