HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Moduletime-hourglass-0.3.0Haskell2010

Time.Epoch

Types, type classes and functions related to epochs.

Contents
  1. Elapsed time from epochs
  2. Epoch
  3. Commonly-encountered epochs
Synopsis

Elapsed time from epochs

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

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

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