--
-- >>> import Data.Maybe ( fromJust )
-- >>> :{
--- let parse_date :: String -> Maybe UTCTime;
--- parse_date = parseTime defaultTimeLocale date_format;
+-- let parse_date :: String -> Maybe UTCTime
+-- parse_date = parseTime defaultTimeLocale date_format
-- :}
--
-- >>> let dates = [ "1/" ++ (d : "/1970") | d <- ['1'..'9'] ]
xp_time_stamp =
(parse_time_stamp, from_time_stamp) `xpWrapMaybe` xpText
where
+ -- | We have to re-pad the time_stamp_format with a leading and
+ -- trailing space; see the documentation of 'time_stamp_format'
+ -- for more information.
from_time_stamp :: UTCTime -> String
from_time_stamp =
- formatTime defaultTimeLocale time_stamp_format
+ formatTime defaultTimeLocale (" " ++ time_stamp_format ++ " ")