Safe Haskell | None |
---|
XSD dateTime
data structure http://www.w3.org/TR/xmlschema-2/#dateTime
- data DateTime
- isZoned :: DateTime -> Bool
- isUnzoned :: DateTime -> Bool
- dateTime' :: Text -> Either String DateTime
- dateTime :: Text -> Maybe DateTime
- toText :: DateTime -> Text
- fromZonedTime :: ZonedTime -> DateTime
- toUTCTime :: DateTime -> Maybe UTCTime
- fromUTCTime :: UTCTime -> DateTime
- toLocalTime :: DateTime -> Maybe LocalTime
- fromLocalTime :: LocalTime -> DateTime
- utcTime' :: Text -> Either String UTCTime
- utcTime :: Text -> Maybe UTCTime
- localTime' :: Text -> Either String LocalTime
- localTime :: Text -> Maybe LocalTime
Documentation
XSD dateTime
data structure
http://www.w3.org/TR/xmlschema-2/#dateTime. Briefly, a dateTime
uses the Gregorian calendar and may or may not have an associated
timezone. If it has a timezone, then the canonical representation
of that date time is in UTC.
Note, it is not possible to establish a total order on dateTime
since non-timezoned are considered to belong to some unspecified
timezone.
dateTime' :: Text -> Either String DateTimeSource
Parses the string into a dateTime
or may fail with a parse error.
fromZonedTime :: ZonedTime -> DateTimeSource
Converts a zoned time to a dateTime
.
toUTCTime :: DateTime -> Maybe UTCTimeSource
Attempts to convert a dateTime
to a UTC time. The attempt fails
if the given dateTime
is non-timezoned.
fromUTCTime :: UTCTime -> DateTimeSource
Converts a UTC time to a timezoned dateTime
.
toLocalTime :: DateTime -> Maybe LocalTimeSource
Attempts to convert a dateTime
to a local time. The attempt
fails if the given dateTime
is timezoned.
fromLocalTime :: LocalTime -> DateTimeSource
Converts a local time to an non-timezoned dateTime
.
utcTime' :: Text -> Either String UTCTimeSource
Parses the string in a dateTime
then converts to a UTC time and
may fail with a parse error.
utcTime :: Text -> Maybe UTCTimeSource
Parses the string in a dateTime
then converts to a UTC time and
may fail.