--- |Format a 'LocalTime' in the ANSI C's asctime() way.
-format :: LocalTime -> String
-format localTime
- = let (year, month, day) = toGregorian (localDay localTime)
- (_, _, week) = toWeekDate (localDay localTime)
- timeOfDay = localTimeOfDay localTime
- in
- concat [ shortWeekDayName week
- , ", "
- , shortMonthName month
- , " "
- , show2 day
- , " "
- , show2 (todHour timeOfDay)
- , ":"
- , show2 (todMin timeOfDay)
- , ":"
- , show2 (floor (todSec timeOfDay))
- , " "
- , show4 year
- ]
+-- |Convert a 'LocalTime' to ANSI C's @asctime()@ string.
+toAscii ∷ LocalTime → Ascii
+toAscii = A.fromAsciiBuilder ∘ toAsciiBuilder