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

Data.Time.Format.C

Description

This module provides functions for ANSI C's date and time strings.

ANSI C's ctime(3)/asctime(3) format looks like:

Wdy Mon [D]D 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 | SP 1DIGIT
 time      ::= 2DIGIT ':' 2DIGIT [':' 2DIGIT]
 year      ::= 4DIGIT

Synopsis

Documentation

data C Source

The phantom type for conversions between ANSI C's date and time strings and LocalTime.

>>> convertSuccess (Tagged (LocalTime (ModifiedJulianDay 49662) (TimeOfDay 8 49 37)) :: Tagged C LocalTime)
"Sun Nov  6 08:49:37 1994"

Instances

ConvertAttempt Ascii (Tagged C LocalTime) 
Default (Parser (Tagged C LocalTime))

Parse an ANSI C's date and time string.

ConvertSuccess (Tagged C LocalTime) AsciiBuilder 
ConvertSuccess (Tagged C LocalTime) Ascii 
ConvertAttempt (Tagged C LocalTime) AsciiBuilder 
ConvertAttempt (Tagged C LocalTime) Ascii