| Safe Haskell | Safe |
|---|---|
| Language | GHC2021 |
Data.Time.Format.ISO8601
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
- 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)
- isoMakeTimeOfDayValid :: Int -> Int -> Pico -> Maybe TimeOfDay
Format
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
Instances
| ISO8601 CalendarDiffDays # |
|
Defined in Data.Time.Format.ISO8601 Methods | |
| ISO8601 Day # |
|
Defined in Data.Time.Format.ISO8601 Methods iso8601Format :: Format Day # | |
| ISO8601 UTCTime # |
|
Defined in Data.Time.Format.ISO8601 Methods | |
| ISO8601 CalendarDiffTime # |
|
Defined in Data.Time.Format.ISO8601 Methods | |
| ISO8601 LocalTime # |
|
Defined in Data.Time.Format.ISO8601 Methods | |
| ISO8601 TimeOfDay # |
|
Defined in Data.Time.Format.ISO8601 Methods | |
| ISO8601 TimeZone # |
|
Defined in Data.Time.Format.ISO8601 Methods | |
| ISO8601 ZonedTime # |
|
Defined in Data.Time.Format.ISO8601 Methods | |
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 | 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 #
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 #
yyyy-mm-dd (extended), yyyymmdd (basic) [ISO 8601:2004(E) sec. 4.1.2.2]
yearMonthFormat :: Format (Integer, Int) #
yyyy-mm [ISO 8601:2004(E) sec. 4.1.2.3(a)]
yearFormat :: Format Integer #
yyyy [ISO 8601:2004(E) sec. 4.1.2.3(b)]
centuryFormat :: Format Integer #
yy [ISO 8601:2004(E) sec. 4.1.2.3(c)]
expandedCalendarFormat :: Int -> FormatExtension -> Format Day #
±yyyyy-mm-dd (extended), ±yyyyymmdd (basic) [ISO 8601:2004(E) sec. 4.1.2.4(a)]
expandedYearMonthFormat :: Int -> Format (Integer, Int) #
±yyyyy-mm [ISO 8601:2004(E) sec. 4.1.2.4(b)]
expandedYearFormat :: Int -> Format Integer #
±yyyyy [ISO 8601:2004(E) sec. 4.1.2.4(c)]
expandedCenturyFormat :: Int -> Format Integer #
±yyy [ISO 8601:2004(E) sec. 4.1.2.4(d)]
ordinalDateFormat :: FormatExtension -> Format Day #
yyyy-ddd (extended), yyyyddd (basic) [ISO 8601:2004(E) sec. 4.1.3.2]
expandedOrdinalDateFormat :: Int -> FormatExtension -> Format Day #
yyyyy-ddd (extended), yyyyyddd (basic) [ISO 8601:2004(E) sec. 4.1.3.3]
weekDateFormat :: FormatExtension -> Format Day #
yyyy-Www-D (extended), yyyyWwwd (basic) [ISO 8601:2004(E) sec. 4.1.4.2]
yearWeekFormat :: FormatExtension -> Format (Integer, Int) #
yyyy-Www (extended), yyyyWww (basic) [ISO 8601:2004(E) sec. 4.1.4.3]
expandedWeekDateFormat :: Int -> FormatExtension -> Format Day #
±yyyyy-Www-d (extended), ±yyyyyWwwD (basic) [ISO 8601:2004(E) sec. 4.1.4.4]
expandedYearWeekFormat :: Int -> FormatExtension -> Format (Integer, Int) #
±yyyyy-Www (extended), ±yyyyyWww (basic) [ISO 8601:2004(E) sec. 4.1.4.4]
timeOfDayFormat :: FormatExtension -> Format TimeOfDay #
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 #
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 #
hh[.hh] [ISO 8601:2004(E) sec. 4.2.2.3(b), 4.2.2.4(c)]
withTimeDesignator :: Format t -> Format t #
Tx [ISO 8601:2004(E) sec. 4.2.2.5]
withUTCDesignator :: Format t -> Format t #
xZ [ISO 8601:2004(E) sec. 4.2.4]
timeOffsetFormat :: FormatExtension -> Format TimeZone #
±hh:mm (extended), ±hhmm (basic) [ISO 8601:2004(E) sec. 4.2.5.1]
timeOfDayAndOffsetFormat :: FormatExtension -> Format (TimeOfDay, TimeZone) #
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 #
xTy [ISO 8601:2004(E) sec. 4.3.2]
zonedTimeFormat :: Format Day -> Format TimeOfDay -> FormatExtension -> Format ZonedTime #
xTy±hh:mm (extended), xTy±hhmm (basic) [ISO 8601:2004(E) sec. 4.3.2]
utcTimeFormat :: Format Day -> Format TimeOfDay -> Format UTCTime #
xTyZ [ISO 8601:2004(E) sec. 4.3.2]
dayAndTimeFormat :: Format Day -> Format time -> Format (Day, time) #
xTy [ISO 8601:2004(E) sec. 4.3.3]
timeAndOffsetFormat :: Format t -> FormatExtension -> Format (t, TimeZone) #
x±hh:mm (extended), x±hhmm (basic) [ISO 8601:2004(E) sec. 4.3.3]
durationDaysFormat :: Format CalendarDiffDays #
PyyYmmMddD [ISO 8601:2004(E) sec. 4.4.3.2]
durationTimeFormat :: Format CalendarDiffTime #
PyyYmmMddDThhHmmMss[.ss]S [ISO 8601:2004(E) sec. 4.4.3.2]
alternativeDurationDaysFormat :: FormatExtension -> Format CalendarDiffDays #
Pyyyy-mm-dd (extended), Pyyyymmdd (basic) [ISO 8601:2004(E) sec. 4.4.3.3]
alternativeDurationTimeFormat :: FormatExtension -> Format CalendarDiffTime #
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) #
x/y [ISO 8601:2004(E) sec. 4.4.4.1]
recurringIntervalFormat :: Format a -> Format b -> Format (Int, a, b) #
Rn/x/y [ISO 8601:2004(E) sec. 4.5]
Other
isoMakeTimeOfDayValid :: Int -> Int -> Pico -> Maybe TimeOfDay #
Like makeTimeOfDayValid, but accepts 24 0 0 per ISO 8601:2004(E) sec. 4.2.3
Since: time-1.12
Orphan instances
| Read CalendarDiffDays # | |
Methods readsPrec :: Int -> ReadS CalendarDiffDays # readList :: ReadS [CalendarDiffDays] # | |
| Read CalendarDiffTime # | |
Methods readsPrec :: Int -> ReadS CalendarDiffTime # readList :: ReadS [CalendarDiffTime] # | |
| Show CalendarDiffDays # | |
Methods showsPrec :: Int -> CalendarDiffDays -> ShowS # show :: CalendarDiffDays -> String # showList :: [CalendarDiffDays] -> ShowS # | |
| Show CalendarDiffTime # | |
Methods showsPrec :: Int -> CalendarDiffTime -> ShowS # show :: CalendarDiffTime -> String # showList :: [CalendarDiffTime] -> ShowS # | |