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-compat-1.9.8Haskell2010

Data.Time.LocalTime.Compat

  • 5 types
  • 33 values
  • Packagetime-compat-1.9.8
  • Exports38
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceTimeZone.hs

Time zones

8 declarations
datadata TimeZone
#

A TimeZone is a whole number of minutes offset from UTC, together with a name and a "just for summer" flag.

Constructors

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

Get the configured time-zone for a given time (varying as per summertime adjustments).

On Unix systems the output of this function depends on:

  1. The value of TZ environment variable (if set)

  2. The system time zone (usually configured by /etc/localtime symlink)

For details see tzset(3) and localtime(3).

Example:

> let t = UTCTime (fromGregorian 2021 7 1) 0
> getTimeZone t
CEST
> setEnv "TZ" "America/New_York" >> getTimeZone t
EDT
> setEnv "TZ" "Europe/Berlin" >> getTimeZone t
CEST

On Windows systems the output of this function depends on:

  1. The value of TZ environment variable (if set). See here for how Windows interprets this variable.

  2. The system time zone, configured in Settings

Time of day

14 declarations
datadata TimeOfDay
#

Time of day as represented in hour, minute and second (with picoseconds), typically used to express local time of day.

TimeOfDay 24 0 0 is considered invalid for the purposes of makeTimeOfDayValid, as well as reading and parsing, but valid for ISO 8601 parsing in Data.Time.Format.ISO8601.

Constructors

  • TimeOfDay
    • todHour :: Int

      range 0 - 23

    • todMin :: Int

      range 0 - 59

    • todSec :: Pico

      Note that 0 <= todSec < 61, accomodating leap seconds. Any local minute may have a leap second, since leap seconds happen in all zones simultaneously

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

CalendarDiffTime

4 declarations
datadata CalendarDiffTime
#
Instances11Eq, Data, Show, Generic, Semigroup, Monoid, …

Local Time

7 declarations
datadata LocalTime
#

A simple day and time aggregate, where the day is of the specified parameter, and the time is a TimeOfDay. Conversion of this (as local civil time) to UTC depends on the time zone. Conversion of this (as local mean time) to UT1 depends on the longitude.

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

Zoned Time

5 declarations
datadata ZonedTime
#

A local time together with a time zone.

There is no Eq instance for ZonedTime. If you want to compare local times, use zonedTimeToLocalTime. If you want to compare absolute times, use zonedTimeToUTC.

Instances9Data, Read, Show, Generic, NFData, FormatTime, …