, parse
)
where
-
-import qualified Text.Parsec as P
-
import Data.Time
import Data.Time.Calendar.WeekDate
import Data.Time.HTTP.Common
-import Data.Time.Asctime.Parsec
+import Data.Time.Asctime.Internal
-- |Format a 'LocalTime' in the ANSI C's asctime() way.
format :: LocalTime -> String
{-# LANGUAGE FlexibleContexts #-}
-module Data.Time.Asctime.Parsec
+module Data.Time.Asctime.Internal
( asctime
)
where
-
import Control.Monad
import Data.Fixed
import Data.Time
import Data.Time.Calendar.WeekDate
import Data.Time.HTTP.Common
-import Text.Parsec
-- |This is a parsec parser for ANSI C's asctime() format.
asctime :: Stream s m Char => ParsecT s u m LocalTime
, parse
)
where
-
import qualified Data.Time.RFC1123 as RFC1123
-import qualified Text.Parsec as P
-
import Data.Time
-import Data.Time.HTTP.Parsec
+import Data.Time.HTTP.Internal
-- |Format an 'UTCTime' in RFC 1123 date and time.
format :: UTCTime -> String
, assertTimeOfDayIsGood
)
where
-
import Control.Monad
import Data.Fixed
import Data.Time
import Data.Time.Calendar.WeekDate
-import Text.Parsec
shortWeekDayName :: Int -> String
shortWeekDayName 1 = "Mon"
{-# LANGUAGE FlexibleContexts #-}
-module Data.Time.HTTP.Parsec
+module Data.Time.HTTP.Internal
( rfc2616DateAndTime
)
where
-
import Control.Monad
import Data.Time
-import Data.Time.RFC1123.Parsec
-import Data.Time.RFC733.Parsec
-import Data.Time.Asctime.Parsec
-import Text.Parsec
+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).
, parse
)
where
-
-import qualified Text.Parsec as P
-
import Data.Time
import Data.Time.Calendar.WeekDate
import Data.Time.HTTP.Common
import Data.Time.RFC822 (showRFC822TimeZone)
-import Data.Time.RFC1123.Parsec
+import Data.Time.RFC1123.Internal
-- |Format a 'ZonedTime' in RFC 1123.
format :: ZonedTime -> String
{-# LANGUAGE FlexibleContexts #-}
-module Data.Time.RFC1123.Parsec
+module Data.Time.RFC1123.Internal
( rfc1123DateAndTime
)
where
-
import Control.Monad
import Data.Fixed
import Data.Time
import Data.Time.Calendar.WeekDate
import Data.Time.HTTP.Common
-import Data.Time.RFC822.Parsec
-import Text.Parsec
+import Data.Time.RFC822.Internal
-- |This is a parsec parser for RFC 1123 date and time strings.
rfc1123DateAndTime :: Stream s m Char => ParsecT s u m ZonedTime
, parse
)
where
-
-import qualified Text.Parsec as P
-
import Data.Time
import Data.Time.Calendar.WeekDate
import Data.Time.HTTP.Common
-import Data.Time.RFC733.Parsec
+import Data.Time.RFC733.Internal
-- |Format a 'ZonedTime' in RFC 733.
format :: ZonedTime -> String
{-# LANGUAGE FlexibleContexts #-}
-module Data.Time.RFC733.Parsec
+module Data.Time.RFC733.Internal
( rfc733DateAndTime
)
where
-
import Control.Monad
import Data.Fixed
import Data.Time
import Data.Time.Calendar.WeekDate
import Data.Time.HTTP.Common
-import Text.Parsec
-- |This is a parsec parser for RFC 733 date and time strings.
rfc733DateAndTime :: Stream s m Char => ParsecT s u m ZonedTime
-{-# OPTIONS_HADDOCK prune #-}
-
-- |This module provides functions to parse and format RFC 822 date
-- and time formats.
--
, showRFC822TimeZone
)
where
-
-import qualified Text.Parsec as P
-
import Data.Time
import Data.Time.Calendar.WeekDate
import Data.Time.HTTP.Common
-import Data.Time.RFC822.Parsec
+import Data.Time.RFC822.Internal
-- |Format a 'ZonedTime' in RFC 822.
format :: ZonedTime -> String
, showRFC822TimeZone timeZone
]
+-- private
showRFC822TimeZone :: TimeZone -> String
showRFC822TimeZone tz
| timeZoneMinutes tz == 0 = "GMT"
{-# LANGUAGE FlexibleContexts #-}
-{-# OPTIONS_HADDOCK prune #-}
-
-module Data.Time.RFC822.Parsec
+module Data.Time.RFC822.Internal
( rfc822DateAndTime
-- private
, rfc822time
)
where
-
import Control.Monad
import Data.Fixed
import Data.Time
import Data.Time.Calendar.WeekDate
import Data.Time.HTTP.Common
-import Text.Parsec
-- |This is a parsec parser for RFC 822 date and time strings.
rfc822DateAndTime :: Stream s m Char => ParsecT s u m ZonedTime
Name: time-http
-Version: 0.1.0.1
+Version: 0.2
Synopsis: Parse and format HTTP/1.1 Date and Time strings
Description:
This package provides functionalities to parse and format
Library
Exposed-modules:
Data.Time.RFC733
- Data.Time.RFC733.Parsec
+ Data.Time.RFC733.Internal
Data.Time.RFC822
- Data.Time.RFC822.Parsec
+ Data.Time.RFC822.Internal
Data.Time.RFC1123
- Data.Time.RFC1123.Parsec
+ Data.Time.RFC1123.Internal
Data.Time.Asctime
- Data.Time.Asctime.Parsec
+ Data.Time.Asctime.Internal
Data.Time.HTTP
- Data.Time.HTTP.Parsec
+ Data.Time.HTTP.Internal
Other-modules:
Data.Time.HTTP.Common
Build-depends:
- base == 4.3.*,
- parsec == 3.1.*,
- time == 1.2.*
+ ascii == 0.0.*,
+ attoparsec == 0.9.*,
+ base == 4.3.*,
+ base-unicode-symbols == 0.2.*,
+ time == 1.2.*
Extensions:
FlexibleContexts