HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduletime-1.12.2Haskell2010

Data.Time.Clock

Types and functions for UTC and UT1

  • 4 types
  • 10 values
  • Packagetime-1.12.2
  • Exports14
  • LanguageHaskell2010
  • LicenceBSD-2-Clause
  • SourceClock.hs
newtypenewtype UniversalTime
#

The Modified Julian Date is the day with the fraction of the day, measured from UT midnight. It's used to represent UT1, which is time as measured by the earth's rotation, adjusted for various wobbles.

Instances8Eq, Data, Ord, Read, Show, NFData, …
newtypenewtype DiffTime
#

This is a length of time, as measured by a clock. Conversion functions such as fromInteger and realToFrac will treat it as seconds. For example, (0.010 :: DiffTime) corresponds to 10 milliseconds.

It has a precision of one picosecond (= 10^-12 s). Enumeration functions will treat it as picoseconds.

Instances13Enum, Eq, Fractional, Data, Num, Ord, …
  • Enum DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Eq DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Fractional DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Data DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Num DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Ord DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Read DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Real DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • RealFrac DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Show DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • NFData DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • FormatTime DiffTimeDefined in time-1.12.2 · Data.Time.Format.Format.Instances · orphan
  • ParseTime DiffTimeDefined in time-1.12.2 · Data.Time.Format.Parse.Instances · orphan
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.

Constructors

Instances9Eq, Data, Ord, Read, Show, NFData, …
  • Eq UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTime
  • Data UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTime
  • Ord UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTime
  • Read UTCTimeDefined in time-1.12.2 · Data.Time.Format.Parse · orphan
  • Show UTCTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.ZonedTime · orphan
  • NFData UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTime
  • FormatTime UTCTimeDefined in time-1.12.2 · Data.Time.Format.Format.Instances · orphan
  • ParseTime UTCTimeDefined in time-1.12.2 · Data.Time.Format.Parse.Instances · orphan
  • ISO8601 UTCTimeDefined in time-1.12.2 · Data.Time.Format.ISO8601

    yyyy-mm-ddThh:mm:ss[.sss]Z (ISO 8601:2004(E) sec. 4.3.2 extended format)

newtypenewtype NominalDiffTime
#

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

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

It has a precision of one picosecond (= 10^-12 s). 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.

Instances13Enum, Eq, Fractional, Data, Num, Ord, …