1 module Data.Time.Asctime
7 import qualified Text.Parsec as P
10 import Data.Time.Calendar.WeekDate
11 import Data.Time.HTTP.Common
12 import Data.Time.Asctime.Parsec
15 Wdy Mon DD HH:MM:SS YYYY
18 format :: LocalTime -> String
20 = let (year, month, day) = toGregorian (localDay localTime)
21 (_, _, week) = toWeekDate (localDay localTime)
22 timeOfDay = localTimeOfDay localTime
24 concat [ shortWeekDayName week
26 , shortMonthName month
30 , show2 (todHour timeOfDay)
32 , show2 (todMin timeOfDay)
34 , show2 (floor (todSec timeOfDay))
39 parse :: String -> Maybe LocalTime
40 parse src = case P.parse p "" src of