OverloadedStrings
, UnicodeSyntax
#-}
+-- |Internal functions for "Data.Time.Asctime".
module Data.Time.Asctime.Internal
( asctime
, toAsciiBuilder
-- |Parse an ANSI C's @asctime()@ string.
asctime ∷ Parser LocalTime
asctime = do weekDay ← shortWeekDayNameP
- _ ← string ", "
+ _ ← char ' '
month ← shortMonthNameP
_ ← char ' '
- day ← read2
+ day ← read2'
_ ← char ' '
hour ← read2
_ ← char ':'
timeOfDay = localTimeOfDay localTime
in
shortWeekDayName week
- ⊕ A.toAsciiBuilder "⊕ "
+ ⊕ A.toAsciiBuilder " "
⊕ shortMonthName month
⊕ A.toAsciiBuilder " "
- ⊕ show2 day
+ ⊕ show2' day
⊕ A.toAsciiBuilder " "
⊕ show2 (todHour timeOfDay)
⊕ A.toAsciiBuilder ":"