HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulererebase-1.21.2Haskell2010

Data.Time.LocalTime

  • 5 types
  • 33 values
  • Packagererebase-1.21.2
  • Exports38
  • LanguageHaskell2010
  • LicenceMIT
  • SourceLocalTime.hs
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, …

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

datadata CalendarDiffTime
#
Instances11Eq, Data, Show, Generic, Semigroup, Monoid, …
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, …
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, …
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, …