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.RFC3339

Contents

Description

Support for reading and displaying time in the format specified by the RFC3339 http://www.ietf.org/rfc/rfc3339.txt

Example of usage: > > import Data.Time.LocalTime > > showTime :: IO String > showTime = getZonedTime >>= return . showRFC3339 > > example1 = "1985-04-12T23:20:50.52Z" > example2 = "1996-12-19T16:39:57-08:00" > example3 = "1990-12-31T23:59:60Z" > example4 = "1990-12-31T15:59:60-08:00" > example5 = "1937-01-01T12:00:27.87+00:20" > examples = [example1,example2,example3,example4,example5] > > readAll = map readRFC3339 examples

Synopsis

Basic type class

class RFC3339 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

showRFC3339, readRFC3339, formatRFC3339

Instances

RFC3339 String

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