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

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

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).

  • 5 types
  • 12 values
  • Packageold-time-1.1.1.0
  • Exports17
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceTime.hsc

Clock times

2 declarations
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

7 declarations

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

8 declarations
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

converts an internal clock time to a local time, modified by the timezone and daylight savings time settings in force at the time of conversion. Because of this dependence on the local environment, toCalendarTime is in the IO monad.