1 {-# LANGUAGE FlexibleContexts #-}
2 module Data.Time.Asctime.Internal
9 import Data.Time.Calendar.WeekDate
10 import Data.Time.HTTP.Common
12 -- |This is a parsec parser for ANSI C's asctime() format.
13 asctime :: Stream s m Char => ParsecT s u m LocalTime
14 asctime = do weekDay <- shortWeekDayNameP
16 month <- shortMonthNameP
28 gregDay <- assertGregorianDateIsGood year month day
29 _ <- assertWeekDayIsGood weekDay gregDay
30 tod <- assertTimeOfDayIsGood hour minute second
32 return (LocalTime gregDay tod)