Copyright | (c) 2014 Vincent Hanquez <vincent@snarc.org> |
---|---|
License | BSD-style |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
Time.Epoch
Description
Types 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
Elapsed time from the start of epochs
newtype ElapsedSince epoch Source #
A type representing the number of seconds that have elapsed since the start of a specified epoch.
Constructors
ElapsedSince Seconds |
Instances
data ElapsedSinceP epoch Source #
A type representing the number of seconds and nanoseconds that have elapsed since the start of a 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.
Methods
epochName :: epoch -> String Source #
The name of the epoch.
epochDiffToUnix :: epoch -> Seconds Source #
The start of the epoch relative to the start of the Unix epoch (1970-01-01 00:00:00 UTC), in seconds. A negative number means the epoch starts before the starts of the Unix epoch.
Instances
Epoch UnixEpoch Source # | |
Epoch WindowsEpoch Source # | |
Defined in Time.Epoch Methods epochName :: WindowsEpoch -> String Source # |
Commonly-encountered epochs
A type representing the Unix epoch, which started on 1970-01-01 00:00:00 UTC.
Constructors
UnixEpoch |
data WindowsEpoch Source #
A type representing the Windows epoch, which started on 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 # |