iso8601-time-0.1.5: Convert to/from the ISO 8601 time format

Safe Haskell | Safe-Inferred
Language | Haskell98

Data.Time.ISO8601

Synopsis

- formatISO8601 :: UTCTime -> String
- formatISO8601Millis :: UTCTime -> String
- formatISO8601Micros :: UTCTime -> String
- formatISO8601Nanos :: UTCTime -> String
- formatISO8601Picos :: UTCTime -> String
- formatISO8601Javascript :: UTCTime -> String
- parseISO8601 :: String -> Maybe UTCTime

# Documentation

formatISO8601 :: UTCTime -> String Source #

Formats a time in ISO 8601, with up to 12 second decimals.

This is the `formatTime` format `%FT%T%Q` == `%%Y-%m-%dT%%H:%M:%S%Q`.

formatISO8601Millis :: UTCTime -> String Source #

Formats a time in ISO 8601 with up to millisecond precision and trailing zeros. The format is precisely:

    YYYY-MM-DDTHH:mm:ss.sssZ

formatISO8601Micros :: UTCTime -> String Source #

Formats a time in ISO 8601 with up to microsecond precision and trailing zeros. The format is precisely:

    YYYY-MM-DDTHH:mm:ss.ssssssZ

formatISO8601Nanos :: UTCTime -> String Source #

Formats a time in ISO 8601 with up to nanosecond precision and trailing zeros. The format is precisely:

    YYYY-MM-DDTHH:mm:ss.sssssssssZ

formatISO8601Picos :: UTCTime -> String Source #

Formats a time in ISO 8601 with up to picosecond precision and trailing zeros. The format is precisely:

    YYYY-MM-DDTHH:mm:ss.ssssssssssssZ

formatISO8601Javascript :: UTCTime -> String Source #

Formats a time like JavaScript's `new Date().toISOString()` as specified by Mozilla: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString

This is an alias for `formatISO8601Millis`.

parseISO8601 :: String -> Maybe UTCTime Source #

Parses an ISO 8601 string.

Leading and trailing whitespace is accepted. See `parseTimeM` from the `time` package for more details.