Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Data.Time.Format.Compat
Contents
Synopsis
- class FormatTime t
- formatTime :: FormatTime t => TimeLocale -> String -> t -> String
- parseTimeM :: (MonadFail m, ParseTime t) => Bool -> TimeLocale -> String -> String -> m t
- parseTimeOrError :: ParseTime t => Bool -> TimeLocale -> String -> String -> t
- readSTime :: ParseTime t => Bool -> TimeLocale -> String -> ReadS t
- readPTime :: ParseTime t => Bool -> TimeLocale -> String -> ReadP t
- parseTime :: ParseTime t => TimeLocale -> String -> String -> Maybe t
- readTime :: ParseTime t => TimeLocale -> String -> String -> t
- readsTime :: ParseTime t => TimeLocale -> String -> ReadS t
- class ParseTime t
- data TimeLocale = TimeLocale {
- wDays :: [(String, String)]
- months :: [(String, String)]
- amPm :: (String, String)
- dateTimeFmt :: String
- dateFmt :: String
- timeFmt :: String
- time12Fmt :: String
- knownTimeZones :: [TimeZone]
- defaultTimeLocale :: TimeLocale
- iso8601DateFormat :: Maybe String -> String
- rfc822DateFormat :: String
UNIX-style formatting
class FormatTime t #
Minimal complete definition
formatCharacter
Instances
FormatTime Day | |
Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> Day -> String) | |
FormatTime UTCTime | |
Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> UTCTime -> String) | |
FormatTime UniversalTime | |
Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> UniversalTime -> String) | |
FormatTime LocalTime | |
Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> LocalTime -> String) | |
FormatTime TimeOfDay | |
Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> TimeOfDay -> String) | |
FormatTime TimeZone | |
Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> TimeZone -> String) | |
FormatTime ZonedTime | |
Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> ZonedTime -> String) | |
FormatTime DayOfWeek Source # | |
Defined in Data.Time.Calendar.Compat Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> DayOfWeek -> String) |
formatTime :: FormatTime t => TimeLocale -> String -> t -> String #
UNIX-style parsing
Note in compat mode acceptWS argument is ignored, it's always True
.
Arguments
:: (MonadFail m, ParseTime t) | |
=> Bool | Accept leading and trailing whitespace? |
-> TimeLocale | Time locale. |
-> String | Format string. |
-> String | Input string. |
-> m t | Return the time value, or fail if the in |
Parses a time value given a format string.
This variant from time-compat
has always MonadFail
constraint.
Look at parseTimeM
for documentation.
parseTimeOrError :: ParseTime t => Bool -> TimeLocale -> String -> String -> t #
readSTime :: ParseTime t => Bool -> TimeLocale -> String -> ReadS t #
readPTime :: ParseTime t => Bool -> TimeLocale -> String -> ReadP t #
parseTime :: ParseTime t => TimeLocale -> String -> String -> Maybe t #
readTime :: ParseTime t => TimeLocale -> String -> String -> t #
readsTime :: ParseTime t => TimeLocale -> String -> ReadS t #
Minimal complete definition
buildTime
Instances
ParseTime Day | |
Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe Day | |
ParseTime UTCTime | |
Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe UTCTime | |
ParseTime UniversalTime | |
Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe UniversalTime | |
ParseTime LocalTime | |
Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe LocalTime | |
ParseTime TimeOfDay | |
Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe TimeOfDay | |
ParseTime TimeZone | |
Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe TimeZone | |
ParseTime ZonedTime | |
Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe ZonedTime |
Locale
data TimeLocale #
Constructors
TimeLocale | |
Fields
|
Instances
Eq TimeLocale | |
Defined in Data.Time.Format.Locale | |
Ord TimeLocale | |
Defined in Data.Time.Format.Locale Methods compare :: TimeLocale -> TimeLocale -> Ordering (<) :: TimeLocale -> TimeLocale -> Bool (<=) :: TimeLocale -> TimeLocale -> Bool (>) :: TimeLocale -> TimeLocale -> Bool (>=) :: TimeLocale -> TimeLocale -> Bool max :: TimeLocale -> TimeLocale -> TimeLocale min :: TimeLocale -> TimeLocale -> TimeLocale | |
Show TimeLocale | |
Defined in Data.Time.Format.Locale Methods showsPrec :: Int -> TimeLocale -> ShowS show :: TimeLocale -> String showList :: [TimeLocale] -> ShowS |
iso8601DateFormat :: Maybe String -> String #
rfc822DateFormat :: String #