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

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Moduleio-classes-1.8.0.1

Control.Monad.Class.MonadTime

  • 2 types
  • 2 classes
  • 2 values
newtypenewtype NominalDiffTime
#

This is a length of time, as measured by UTC. It has a precision of one picosecond (10^-12 s).

Conversion functions such as fromInteger and realToFrac will treat it as seconds. For example, (0.010 :: NominalDiffTime) corresponds to 10 milliseconds.

Enumeration functions will treat it as picoseconds.

It ignores leap-seconds, so it's not necessarily a fixed amount of clock time. For instance, 23:00 UTC + 2 hours of NominalDiffTime = 01:00 UTC (+ 1 day), regardless of whether a leap-second intervened.

Instances14Enum, Eq, Fractional, Data, Num, Ord, …
datadata UTCTime
#

This is the simplest representation of UTC. It consists of the day number, and a time offset from midnight. Note that if a day has a leap second added to it, it will have 86401 seconds.

Instances12Eq, Data, Ord, Read, Show, Generic, …