parseTime package:thyme

Parse a string as a ParseTime instance value. Return Nothing if parsing fails.

Examples

ISO 8601

> parseTime defaultTimeLocale "%Y-%m-%dT%H:%M:%S%N" "2015-01-15T12:34:56+00:00" :: Maybe UTCTime
Just 2015-01-15 12:34:56 UTC

> parseTime defaultTimeLocale "%Y-%m-%dT%H:%M:%S%N" "2015-01-15T12:34:56-12:00" :: Maybe UTCTime
Just 2015-01-16 00:34:56 UTC

YYYY-MM-DD hh:mm:ss.0

> parseTime defaultTimeLocale "%Y-%m-%d %H:%M:%S%Q" "2015-01-15 12:34:56.78" :: Maybe UTCTime
Just 2015-01-15 12:34:56.78 UTC
All instances of this class may be parsed by parseTime, readTime, and readsTime.