HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduleold-time-1.1.1.0Haskell2010

System.Time

The standard time library from Haskell 98. This library is deprecated, please look at Data.Time in the time package instead.

System.Time provides functionality for clock times, including timezone information (i.e, the functionality of "time.h", adapted to the Haskell environment). It follows RFC 1129 in its use of Coordinated Universal Time (UTC).

Contents
  1. Clock times
  2. Time differences
  3. Calendar times
Synopsis
  • Packageold-time-1.1.1.0
  • Exports17
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceTime.hsc

Clock times

datadata ClockTime

A representation of the internal clock time. Clock times may be compared, converted to strings, or converted to an external calendar time CalendarTime for I/O or other manipulations.

Constructors

  • TOD Integer Integer

    Construct a clock time. The arguments are a number of seconds since 00:00:00 (UTC) on 1 January 1970, and an additional number of picoseconds.

    In Haskell 98, the ClockTime type is abstract.

Instances3Eq, Ord, Show

Time differences

addToClockTime d t adds a time difference d and a clock time t to yield a new clock time. The difference d may be either positive or negative.

Strange things can happen when TimeDiff has non-zero months and years, including but not limited to ±1 hour jump when passing in and out daylight saving time.

Converts a time difference to normal form.

This function assumes that each month contains exactly 30 days and each year contains exactly 365 days, which is not true.

Calendar times

datadata CalendarTime

CalendarTime is a user-readable and manipulable representation of the internal ClockTime type.

Constructors

Instances4Eq, Ord, Read, Show
datadata Month
Instances7Bounded, Enum, Eq, Ord, Read, Show, …
  • Bounded MonthDefined in old-time-1.1.1.0 · System.Time
  • Enum MonthDefined in old-time-1.1.1.0 · System.Time
  • Eq MonthDefined in old-time-1.1.1.0 · System.Time
  • Ord MonthDefined in old-time-1.1.1.0 · System.Time
  • Read MonthDefined in old-time-1.1.1.0 · System.Time
  • Show MonthDefined in old-time-1.1.1.0 · System.Time
  • Ix MonthDefined in old-time-1.1.1.0 · System.Time