Module

Temporal.Internal.Types

Package
purescript-temporal
Repository
philippedev101/purescript-temporal

Internal module defining foreign Temporal types with their core typeclass instances. These types are re-exported from their respective modules (e.g. Temporal.Duration, Temporal.Instant, etc.).

#Duration Source

data Duration

A length of time expressed as a combination of date and time components (years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds). All components must share the same sign.

Durations are unbalanced{ hours: 36 } is not automatically converted to { days: 1, hours: 12 }. Use round to balance.

Eq compares component-by-component (not total elapsed time), so { hours: 1 } is not equal to { minutes: 60 }.

Instances

#Instant Source

data Instant

An exact moment on the UTC timeline with nanosecond precision, independent of any time zone or calendar.

Use Instant for timestamps, event logs, and any case where you need an unambiguous point in time. Convert to ZonedDateTime when you need wall-clock representation in a specific time zone.

Instances

#PlainDate Source

data PlainDate

A calendar date without a time component or time zone (e.g. 2024-03-15).

Use PlainDate for birthdays, holidays, and other dates where time of day is irrelevant. Do not use for scheduling events — use ZonedDateTime instead.

Instances

#PlainTime Source

data PlainTime

A wall-clock time without a date or time zone (e.g. 10:30:00). Range: 00:00:00.000000000 to 23:59:59.999999999.

Arithmetic wraps at midnight with no overflow indication.

Instances

#PlainDateTime Source

data PlainDateTime

A calendar date and wall-clock time without a time zone (e.g. 2024-03-15T10:30:00).

Use PlainDateTime for events whose time zone is tracked separately, or for wall-clock displays. For unambiguous moments in time, use Instant or ZonedDateTime instead.

Instances

#PlainYearMonth Source

data PlainYearMonth

A year and month without a day component (e.g. 2024-03).

Useful for representing months in a calendar UI or credit card expiry dates.

Instances

#PlainMonthDay Source

data PlainMonthDay

A month and day without a year component (e.g. 12-25).

Useful for recurring annual dates like birthdays or holidays.

Instances

#ZonedDateTime Source

data ZonedDateTime

A date and time in a specific time zone, with full awareness of UTC offset and DST transitions (e.g. 2024-03-15T10:30:00-04:00[America/New_York]).

This is the richest Temporal type. Use it for scheduling future events where wall-clock time should be preserved even if DST rules change. For past events or timestamps, Instant is usually sufficient.

Instances

#durationToString Source

#instantCompare Source

#instantToString Source

#plainDateToString Source

#plainTimeToString Source

#unsafePlainTimeBottom Source

#unsafePlainTimeTop Source