]> gitweb @ CieloNegro.org - time-http.git/blobdiff - Data/Time/HTTP/Internal.hs
Changed some module's name
[time-http.git] / Data / Time / HTTP / Internal.hs
diff --git a/Data/Time/HTTP/Internal.hs b/Data/Time/HTTP/Internal.hs
new file mode 100644 (file)
index 0000000..06a0ad2
--- /dev/null
@@ -0,0 +1,19 @@
+{-# LANGUAGE FlexibleContexts #-}
+module Data.Time.HTTP.Internal
+    ( rfc2616DateAndTime
+    )
+    where
+import Control.Monad
+import Data.Time
+import Data.Time.RFC1123.Internal
+import Data.Time.RFC733.Internal
+import Data.Time.Asctime.Internal
+
+-- |This is a parsec parser for date and time formats allowed in
+-- HTTP\/1.1 (RFC 2616).
+rfc2616DateAndTime :: Stream s m Char => ParsecT s u m UTCTime
+rfc2616DateAndTime
+    = choice [ liftM zonedTimeToUTC $ try rfc1123DateAndTime
+             , liftM zonedTimeToUTC $ try rfc733DateAndTime
+             , liftM (localTimeToUTC utc) asctime
+             ]