X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=time-http.git;a=blobdiff_plain;f=Data%2FTime%2FHTTP%2FInternal.hs;fp=Data%2FTime%2FHTTP%2FInternal.hs;h=0000000000000000000000000000000000000000;hp=e94567076420449fb0c22e27b7fd8bb4f5aef3ad;hb=2064aacf48e193924b6ffe18a50853d233c16b98;hpb=901a3635d37e25a2d4c2e1562c32c68c410fbdd3 diff --git a/Data/Time/HTTP/Internal.hs b/Data/Time/HTTP/Internal.hs deleted file mode 100644 index e945670..0000000 --- a/Data/Time/HTTP/Internal.hs +++ /dev/null @@ -1,36 +0,0 @@ -{-# LANGUAGE - UnicodeSyntax - #-} --- |Internal functions for "Data.Time.HTTP". -module Data.Time.HTTP.Internal - ( httpDateAndTime - , toAsciiBuilder - ) - where -import Control.Applicative -import Data.Ascii (AsciiBuilder) -import Data.Attoparsec.Char8 -import Data.Time -import qualified Data.Time.RFC1123.Internal as RFC1123 -import qualified Data.Time.RFC733.Internal as RFC733 -import qualified Data.Time.Asctime.Internal as Asctime -import Prelude.Unicode - --- |Parse a date and time string in any formats allowed by HTTP\/1.1 --- (RFC 2616). -httpDateAndTime ∷ Parser UTCTime -httpDateAndTime - = choice [ zonedTimeToUTC <$> try RFC1123.rfc1123DateAndTime - , zonedTimeToUTC <$> try RFC733.rfc733DateAndTime - , localTimeToUTC utc <$> Asctime.asctime - ] - --- |Convert a 'UTCTime' to RFC 1123 date and time string. -toAsciiBuilder ∷ UTCTime → AsciiBuilder -toAsciiBuilder = RFC1123.toAsciiBuilder ∘ ut2zt - where - ut2zt ∷ UTCTime → ZonedTime - ut2zt = utcToZonedTime gmt - - gmt ∷ TimeZone - gmt = TimeZone 0 False "GMT"