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

Modulehourglass-0.2.12Haskell2010

Time.Types

Basic times units and types.

While pratically some units could hold infinite values, for practical and efficient purpose they are limited to int64 types for seconds and int types for years.

Most units use the unix epoch referential, but by no means reduce portability. the unix referential works under the Windows platform or any other platforms.

  • 12 types
  • 1 class
  • 2 values
  • Packagehourglass-0.2.12
  • Exports15
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceTypes.hs

Time units

5 declarations
newtypenewtype NanoSeconds
#

Nanoseconds

Constructors

Instances8Eq, Data, Num, Ord, Read, Show, …
newtypenewtype Seconds
#

Number of seconds without a referential.

Can hold a number between [-2^63,2^63-1], which should be good for some billions of years.

However, because of limitation in the calendar conversion currently used, seconds should be in the range [-2^55,2^55-1], which is good for only 1 billion of year.

Constructors

Instances11Enum, Eq, Integral, Data, Num, Ord, …
newtypenewtype Minutes
#

Number of minutes without a referential.

Constructors

Instances11Enum, Eq, Integral, Data, Num, Ord, …
newtypenewtype Hours
#

Number of hours without a referential.

Constructors

Instances11Enum, Eq, Integral, Data, Num, Ord, …
  • Enum HoursDefined in hourglass-0.2.12 · Time.Types
  • Eq HoursDefined in hourglass-0.2.12 · Time.Types
  • Integral HoursDefined in hourglass-0.2.12 · Time.Types
  • Data HoursDefined in hourglass-0.2.12 · Time.Types
  • Num HoursDefined in hourglass-0.2.12 · Time.Types
  • Ord HoursDefined in hourglass-0.2.12 · Time.Types
  • Read HoursDefined in hourglass-0.2.12 · Time.Types
  • Real HoursDefined in hourglass-0.2.12 · Time.Types
  • Show HoursDefined in hourglass-0.2.12 · Time.Types
  • NFData HoursDefined in hourglass-0.2.12 · Time.Types
  • TimeInterval HoursDefined in hourglass-0.2.12 · Time.Types
classclass TimeInterval i where
#

Represent any time interval that has an equivalent value to a number of seconds.

Methods

Instances5TimeInterval

Time enumeration

2 declarations
datadata Month
#
Instances7Bounded, Enum, Eq, Data, Ord, Read, …
  • Bounded MonthDefined in hourglass-0.2.12 · Time.Types
  • Enum MonthDefined in hourglass-0.2.12 · Time.Types
  • Eq MonthDefined in hourglass-0.2.12 · Time.Types
  • Data MonthDefined in hourglass-0.2.12 · Time.Types
  • Ord MonthDefined in hourglass-0.2.12 · Time.Types
  • Read MonthDefined in hourglass-0.2.12 · Time.Types
  • Show MonthDefined in hourglass-0.2.12 · Time.Types
datadata WeekDay
#

Day of the week

the enumeration starts on Sunday.

Instances7Bounded, Enum, Eq, Data, Ord, Read, …

Timezone

3 declarations
newtypenewtype TimezoneOffset
#

Offset against UTC in minutes to obtain from UTC time, local time.

  • a positive number represent a location East of UTC.

  • a negative number represent a location West of UTC.

LocalTime t (-300) = t represent a time at UTC-5 LocalTime t (+480) = t represent a time at UTC+8

should be between -11H and +14H

Example: in AUSEDT (UTC+1000 with daylight = UTC+1100), local time is 15:47; Thus, UTC time is 04:47, and TimezoneOffset is +660 (minutes)

Constructors

Instances5Eq, Data, Ord, Show, NFData

Computer friendly format

0 declarations

Unix elapsed

newtypenewtype Elapsed
#

A number of seconds elapsed since the unix epoch.

Constructors

Instances9Eq, Data, Num, Ord, Read, Show, …
datadata ElapsedP
#

A number of seconds and nanoseconds elapsed since the unix epoch.

Instances10Eq, Data, Num, Ord, Read, Real, …

Human friendly format

0 declarations

Calendar time

datadata Date
#

human date representation using common calendar

Constructors

Instances8Eq, Data, Ord, Read, Show, NFData, …
  • Eq DateDefined in hourglass-0.2.12 · Time.Types
  • Data DateDefined in hourglass-0.2.12 · Time.Types
  • Ord DateDefined in hourglass-0.2.12 · Time.Types
  • Read DateDefined in hourglass-0.2.12 · Time.Types
  • Show DateDefined in hourglass-0.2.12 · Time.Types
  • NFData DateDefined in hourglass-0.2.12 · Time.Types
  • Time DateDefined in hourglass-0.2.12 · Data.Hourglass.Time
  • Timeable DateDefined in hourglass-0.2.12 · Data.Hourglass.Time
datadata TimeOfDay
#

human time representation of hour, minutes, seconds in a day.

Constructors

Instances6Eq, Data, Ord, Read, Show, NFData
datadata DateTime
#

Date and Time

Instances8Eq, Data, Ord, Read, Show, NFData, …