import Data.Maybe
import Data.String.Utils (join, splitWs)
+import Data.Time (ZonedTime, formatTime, readsTime)
+import System.Locale (defaultTimeLocale, rfc822DateFormat)
import Test.HUnit
import Text.Regex (matchRegex, mkRegex)
import Text.XML.HaXml
xml_file_name :: String
xml_file_name = ""
+
+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
+
-- |Returns a nicely-formatted String representing the given 'Status'
-- object.
pretty_print :: Status -> String