xsd-0.4.0: XML Schema data structures

Safe HaskellNone

Text.XML.XSD.DateTime

Description

XSD dateTime data structure http://www.w3.org/TR/xmlschema-2/#dateTime

Synopsis

Documentation

data DateTime Source

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.

isZoned :: DateTime -> BoolSource

Whether the given dateTime is timezoned.

isUnzoned :: DateTime -> BoolSource

Whether the given dateTime is non-timezoned.

dateTime' :: Text -> Either String DateTimeSource

Parses the string into a dateTime or may fail with a parse error.

dateTime :: Text -> Maybe DateTimeSource

Parses the string into a dateTime or may fail.

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.

localTime' :: Text -> Either String LocalTimeSource

Parses the string in a dateTime then converts to a local time and may fail with a parse error.

localTime :: Text -> Maybe LocalTimeSource

Parses the string in a dateTime then converts to a local time time and may fail.