]> gitweb @ CieloNegro.org - time-http.git/blob - Data/Time/HTTP/Internal.hs
Changed some module's name
[time-http.git] / Data / Time / HTTP / Internal.hs
1 {-# LANGUAGE FlexibleContexts #-}
2 module Data.Time.HTTP.Internal
3     ( rfc2616DateAndTime
4     )
5     where
6 import Control.Monad
7 import Data.Time
8 import Data.Time.RFC1123.Internal
9 import Data.Time.RFC733.Internal
10 import Data.Time.Asctime.Internal
11
12 -- |This is a parsec parser for date and time formats allowed in
13 -- HTTP\/1.1 (RFC 2616).
14 rfc2616DateAndTime :: Stream s m Char => ParsecT s u m UTCTime
15 rfc2616DateAndTime
16     = choice [ liftM zonedTimeToUTC $ try rfc1123DateAndTime
17              , liftM zonedTimeToUTC $ try rfc733DateAndTime
18              , liftM (localTimeToUTC utc) asctime
19              ]