License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | unknown |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Data.Hourglass.Epoch
Description
Epoch tracking
Synopsis
- newtype ElapsedSince epoch = ElapsedSince Seconds
- data ElapsedSinceP epoch = ElapsedSinceP !(ElapsedSince epoch) !NanoSeconds
- class Epoch epoch where
- epochName :: epoch -> String
- epochDiffToUnix :: epoch -> Seconds
- data UnixEpoch = UnixEpoch
- data WindowsEpoch = WindowsEpoch
computer time tracking with various epoch
newtype ElapsedSince epoch Source #
A number of seconds elapsed since an epoch.
Constructors
ElapsedSince Seconds |
Instances
data ElapsedSinceP epoch Source #
A number of seconds and nanoseconds elapsed since an epoch.
Constructors
ElapsedSinceP !(ElapsedSince epoch) !NanoSeconds |
Instances
Epoch
class Epoch epoch where Source #
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 -> String Source #
The name of this epoch
epochDiffToUnix :: epoch -> Seconds Source #
number of seconds of difference with 1st January 1970.
a negative number means that this epoch start before the unix epoch.
Instances
Epoch UnixEpoch Source # | |
Epoch WindowsEpoch Source # | |
Defined in Data.Hourglass.Epoch Methods epochName :: WindowsEpoch -> String Source # |
standard and usual epochs
Unix Epoch, starting 1st January 1970
Constructors
UnixEpoch |
data WindowsEpoch Source #
Windows Epoch, starting 1st January 1601
Constructors
WindowsEpoch |
Instances
Show WindowsEpoch Source # | |
Defined in Data.Hourglass.Epoch Methods showsPrec :: Int -> WindowsEpoch -> ShowS # show :: WindowsEpoch -> String # showList :: [WindowsEpoch] -> ShowS # | |
Eq WindowsEpoch Source # | |
Defined in Data.Hourglass.Epoch | |
Epoch WindowsEpoch Source # | |
Defined in Data.Hourglass.Epoch Methods epochName :: WindowsEpoch -> String Source # |