import Data.Time.W3C.Types
parse :: Convertible W3CDateTime t => String -> Maybe t
-parse src
- = case P.parse w3cDateTime "" src of
- Right w3c -> Just (convert w3c)
- Left _ -> Nothing
+parse src = case P.parse p "" src of
+ Right w3c -> Just (convert w3c)
+ Left _ -> Nothing
+ where
+ p = do w3c <- w3cDateTime
+ _ <- P.eof
+ return w3c
\ No newline at end of file
Description:
This module provides functionalities to parse and format W3C
Date and Time. The module can also be used to convert it
- from/to "Data.Time.Calendar.Day" and
- "Data.Time.LocalTime.ZonedTime".
+ from/to 'Data.Time.Calendar.Day' and
+ 'Data.Time.LocalTime.ZonedTime'.
License: PublicDomain
License-file: COPYING