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

Data.Time.Format.RFC733

Description

This module provides functions to parse and format RFC 733 date and time strings (http://tools.ietf.org/html/rfc733#appendix-E).

The syntax is as follows:

 date-time   ::= [ day-of-week ", " ] date SP time ("-" | SP) zone
 day-of-week ::= "Monday"    | "Mon" | "Tuesday"  | "Tue"
               | "Wednesday" | "Wed" | "Thursday" | "Thu"
               | "Friday"    | "Fri" | "Saturday" | "Sat"
               | "Sunday"    | "Sun"
 date        ::= day ("-" | SP) month ("-" | SP) year
 day         ::= 2DIGIT
 year        ::= 2DIGIT | 4DIGIT
 month       ::= "January"   | "Jan" | "February" | "Feb"
               | "March"     | "Mar" | "April"    | "Apr"
               | "May"               | "June"     | "Jun"
               | "July"      | "Jul" | "August"   | "Aug"
               | "September" | "Sep" | "October"  | "Oct"
               | "November"  | "Nov" | "December" | "Dec"
 time        ::= hour [ ":" ] minute [ [ ":" ] second ]
 hour        ::= 2DIGIT
 minute      ::= 2DIGIT
 second      ::= 2DIGIT
 zone        ::= "GMT"              ; Universal Time
               | "NST"              ; Newfoundland: -3:30
               | "AST" | "ADT"      ; Atlantic    :  -4 /  -3
               | "EST" | "EDT"      ; Eastern     :  -5 /  -4
               | "CST" | "CDT"      ; Central     :  -6 /  -5
               | "MST" | "MDT"      ; Mountain    :  -7 /  -6
               | "PST" | "PDT"      ; Pacific     :  -8 /  -7
               | "YST" | "YDT"      ; Yukon       :  -9 /  -8
               | "HST" | "HDT"      ; Haw/Ala     : -10 /  -9
               | "BST" | "BDT"      ; Bering      : -11 / -10
               | "Z"                ; GMT
               | "A"                ;  -1
               | "M"                ; -12
               | "N"                ;  +1
               | "Y"                ; +12
               | ("+" | "-") 4DIGIT ; Local diff: HHMM

Synopsis

Documentation

data RFC733 Source

The phantom type for conversions between RFC 733 date and time strings and ZonedTime.

>>> convertSuccess (Tagged (ZonedTime (LocalTime (ModifiedJulianDay 49662) (TimeOfDay 8 49 37)) utc) :: Tagged RFC733 ZonedTime)
"Sunday, 06-Nov-1994 08:49:37 GMT"

Instances

ConvertAttempt Ascii (Tagged RFC733 ZonedTime) 
Default (Parser (Tagged RFC733 ZonedTime))

Parse an RFC 733 date and time string.

ConvertSuccess (Tagged RFC733 ZonedTime) AsciiBuilder 
ConvertSuccess (Tagged RFC733 ZonedTime) Ascii 
ConvertAttempt (Tagged RFC733 ZonedTime) AsciiBuilder 
ConvertAttempt (Tagged RFC733 ZonedTime) Ascii