Copyright | (c) 2014 Vincent Hanquez <vincent@snarc.org> |
---|---|
License | BSD-style |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
Time.Epoch
Description
Types, type classes and functions related to epochs.
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
- data MJDEpoch = MJDEpoch
Elapsed time from epochs
newtype ElapsedSince epoch Source #
A type representing the number of non-leap seconds that have elapsed since the specified epoch.
Constructors
ElapsedSince Seconds |
Instances
data ElapsedSinceP epoch Source #
A type representing the number of non-leap seconds and nanoseconds that have elapsed since the specified epoch. The 'P' is short for 'precise'.
Constructors
ElapsedSinceP !(ElapsedSince epoch) !NanoSeconds |
Instances
Epoch
class Epoch epoch where Source #
A type class promising epoch-related functionality. (Epochs, in this context, are fixed points in time.)
Methods
epochName :: epoch -> String Source #
The name of the epoch.
epochDiffToUnix :: epoch -> Seconds Source #
The epoch relative to the Unix epoch (1970-01-01 00:00:00 UTC), in non-leap seconds. A negative number means the epoch is before the Unix epoch.
Commonly-encountered epochs
A type representing the Unix epoch (the point in time represented by 1970-01-01 00:00:00 UTC).
Constructors
UnixEpoch |
data WindowsEpoch Source #
A type representing the Windows epoch, (the point in time represented by 1601-01-01 00:00:00 UTC).
Constructors
WindowsEpoch |
Instances
Show WindowsEpoch Source # | |
Defined in Time.Epoch Methods showsPrec :: Int -> WindowsEpoch -> ShowS # show :: WindowsEpoch -> String # showList :: [WindowsEpoch] -> ShowS # | |
Eq WindowsEpoch Source # | |
Defined in Time.Epoch | |
Epoch WindowsEpoch Source # | |
Defined in Time.Epoch Methods epochName :: WindowsEpoch -> String Source # |