timerep-1.0.4: Parse and display time according to some RFCs (RFC3339, RFC2822)

Copyright(c) 2011 Hugo Daniel Gomes
LicenseBSD-style
Maintainermr.hugo.gomes@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.Time.RFC2822

Contents

Description

Support for reading and displaying time in the format specified by the RFC2822 http://www.ietf.org/rfc/rfc2822.txt section 3.3

Example of usage: > > import Data.Time.LocalTime > > showTime :: IO String > showTime = getZonedTime >>= return . showRFC2822 > > example1 = "Fri, 21 Nov 1997 09:55:06 -0600" > example2 = "Tue, 15 Nov 1994 12:45:26 GMT" > example3 = "Tue, 1 Jul 2003 10:52:37 +0200" > example4 = "Thu, 13 Feb 1969 23:32:54 -0330" > example5 = "Mon, 24 Nov 1997 14:22:01 -0800" > example6 = "Thu, 13n Febn 1969n 23:32n -0330" > example7 = "Thu, 13n Febn 1969n 23:32n -0330 (Newfoundland Time)" > example8 = "24 Nov 1997 14:22:01 -0800" > examples = [example1,example2,example3,example4,example5,example6,example7,example8] > > readAll = map readRFC2822 examples

Synopsis

Basic type class

class RFC2822 a where Source

This class is here to allow future support for other data types like Data.Text or Data.ByteString if that becomes necessary

Minimal complete definition

showRFC2822, readRFC2822, formatRFC2822

Instances

RFC2822 String

For now there is only an instance for the String data type