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