+
+created_at_to_rfc822 :: String -> Maybe String
+created_at_to_rfc822 s =
+ case reads_result of
+ [(t,_)] ->
+ Just $ formatTime defaultTimeLocale rfc822DateFormat t
+ _ -> Nothing
+ where
+ -- Should match e.g. "Sun Oct 24 18:21:41 +0000 2010"
+ fmt :: String
+ fmt = "%a %b %d %H:%M:%S %z %Y"
+
+ reads_result :: [(ZonedTime, String)]
+ reads_result = readsTime defaultTimeLocale fmt s
+