hourglass-0.2.2: simple performant time related library

Portabilityunknown
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>
Safe HaskellNone

Data.Hourglass.Epoch

Contents

Description

Epoch tracking

Synopsis

computer time tracking with various epoch

newtype ElapsedSince epoch Source

A number of seconds elapsed since an epoch.

Constructors

ElapsedSince Seconds 

Instances

Typeable1 ElapsedSince 
Eq (ElapsedSince epoch) 
Data epoch => Data (ElapsedSince epoch) 
Num (ElapsedSince epoch) 
Ord (ElapsedSince epoch) 
Read (ElapsedSince epoch) 
Show (ElapsedSince epoch) 
NFData (ElapsedSince epoch) 
Epoch epoch => Time (ElapsedSince epoch) 
Epoch epoch => Timeable (ElapsedSince epoch) 

data ElapsedSinceP epoch Source

A number of seconds and nanoseconds elapsed since an epoch.

Constructors

ElapsedSinceP !(ElapsedSince epoch) !NanoSeconds 

Instances

Epoch

class Epoch epoch whereSource

epoch related.

We use the well known Unix epoch as the reference timezone for doing conversion between epochs.

Each methods of this typeclass should not use the actual value, but only get the information needed from the type itself.

Methods

epochName :: epoch -> StringSource

The name of this epoch

epochDiffToUnix :: epoch -> SecondsSource

number of seconds of difference with 1st January 1970.

a negative number means that this epoch start before the unix epoch.

standard and usual epochs

data UnixEpoch Source

Unix Epoch, starting 1st January 1970

Constructors

UnixEpoch 

data WindowsEpoch Source

Windows Epoch, starting 1st January 1601

Constructors

WindowsEpoch