time-http-0.1.0.1: Parse and format HTTP/1.1 Date and Time strings

Data.Time.Asctime

Description

This module provides functions for ANSI C's asctime() format.

ANSI C's asctime() format looks like:

Wdy Mon DD HH:MM:SS YYYY

The exact syntax is as follows:

 date-time ::= wday SP month SP day SP time SP year
 wday      ::= "Mon" | "Tue" | "Wed" | "Thu"
             | "Fri" | "Sat" | "Sun"
 month     ::= "Jan" | "Feb" | "Mar" | "Apr"
             | "May" | "Jun" | "Jul" | "Aug"
             | "Sep" | "Oct" | "Nov" | "Dec"
 day       ::= 2DIGIT
 time      ::= 2DIGIT ':' 2DIGIT [':' 2DIGIT]
 year      ::= 4DIGIT

As you can see, it has no time zone info. Data.Time.HTTP will treat it as UTC.

Synopsis

Documentation

format :: LocalTime -> StringSource

Format a LocalTime in the ANSI C's asctime() way.

parse :: String -> Maybe LocalTimeSource

Parse an ANSI C's asctime() format to LocalTime. When the string can't be parsed, it returns Nothing.