Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Date format utilities
Synopsis
- dateFormat :: Text -> UTCTime -> Text
- dateFormatISO8601 :: UTCTime -> Text
- data DateParseISO8601Error = DateParseISO8601Error {
- invalidDate :: Text
- dateParseISO8601 :: Text -> Either DateParseISO8601Error UTCTime
Documentation
dateFormat :: Text -> UTCTime -> Text Source #
Formats a date into a Text string using specified formatting string
Arguments:
format :: Text
: Format stringdate :: UTCTime
: Date to format
Return value: String containing a date in a specified format
dateFormatISO8601 :: UTCTime -> Text Source #
Formats a date into a Text string using ISO8601 formatting string
Format: %Y-%m-%d %H:%M:%S
Output example: 2018-11-25 00:00:01
Arguments:
date :: UTCTime
: Date to format
Return value: String containing a date in ISO8601 format
data DateParseISO8601Error Source #
Error record for dateParseISO8601
function
DateParseISO8601Error | |
|
Instances
Show DateParseISO8601Error Source # | |
Defined in VtUtils.Date showsPrec :: Int -> DateParseISO8601Error -> ShowS # show :: DateParseISO8601Error -> String # showList :: [DateParseISO8601Error] -> ShowS # |
dateParseISO8601 :: Text -> Either DateParseISO8601Error UTCTime Source #
Parses Text string using ISO8601 format
Expected input example: 2018-11-25 00:00:01
Arguments:
text :: Text
: Text string containing a date in ISO8601 format
Return value: Parsed date or error message