HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Moduletime-hourglass-0.3.0Haskell2010

Time.Epoch

Types, type classes and functions related to epochs.

  • 5 types
  • 1 class

Elapsed time from epochs

2 declarations
newtypenewtype ElapsedSince epoch
#

A type representing the number of non-leap seconds that have elapsed since the specified epoch.

Constructors

Instances9Eq, Data, Num, Ord, Read, Show, …
datadata ElapsedSinceP epoch
#

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

Instances10Eq, Data, Num, Ord, Read, Real, …

Epoch

1 declaration
classclass Epoch epoch where
#

A type class promising epoch-related functionality. (Epochs, in this context, are fixed points in time.)

Methods

  • epochName :: epoch -> String

    The name of the epoch.

  • epochDiffToUnix :: epoch -> Seconds

    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.

Instances3Epoch

Commonly-encountered epochs

3 declarations
datadata UnixEpoch
#

A type representing the Unix epoch (the point in time represented by 1970-01-01 00:00:00 UTC).

Instances3Eq, Show, Epoch
datadata MJDEpoch
#

A type representing the Modified Julian Date (MJD) epoch (the point in time represented by 1858-11-17 00:00:00 UTC).

Instances3Eq, Show, Epoch