vt-utils-1.0.0.0: Vector and Text utilities

Safe HaskellSafe
LanguageHaskell2010

VtUtils.Date

Description

Date format utilities

Synopsis

Documentation

dateFormat :: Text -> UTCTime -> Text Source #

Formats a date into a Text string using specified formatting string

Arguments:

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

dateParseISO8601 :: Text -> UTCTime Source #

Parses Text string using ISO8601 format

Raises an error, if input string cannot be parsed as ISO8601 date

Expected input example: 2018-11-25 00:00:01

Arguments:

  • text :: Text: Text string containing a date in ISO8601 format

Return value: Parsed date