Module

JS.Temporal.ZonedDateTime

Package
purescript-js-temporal
Repository
pete-murphy/purescript-js-temporal

A date and time with time zone, representing a unique instant plus a time zone and calendar. Use when you need an absolute point in time with human-readable components in a specific zone.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/ZonedDateTime

#new Source

new :: BigInt -> String -> Effect ZonedDateTime

Creates a ZonedDateTime from epoch nanoseconds and a time zone ID.

#from Source

from :: forall provided. ConvertOptionsWithDefaults ToFromOptions (Record FromOptions) (Record provided) (Record FromOptions) => Record provided -> String -> Effect ZonedDateTime

Parses an ISO 8601 string with time zone (e.g. "2024-01-15T12:00-05:00[America/New_York]"). Options: overflow, disambiguation, offset.

#from_ Source

from_ :: String -> Effect ZonedDateTime

Same as from with default options.

#add Source

add :: forall provided. ConvertOptionsWithDefaults ToArithmeticOptions (Record ArithmeticOptions) (Record provided) (Record ArithmeticOptions) => Record provided -> Duration -> ZonedDateTime -> Effect ZonedDateTime

Adds a duration. Supports calendar durations. Options: overflow.

#add_ Source

add_ :: Duration -> ZonedDateTime -> Effect ZonedDateTime

Same as add with default options.

#with Source

with :: forall optsProvided fields rest. Union fields rest WithFields => ConvertOptionsWithDefaults ToFromOptions (Record FromOptions) (Record optsProvided) (Record FromOptions) => Record optsProvided -> Record fields -> ZonedDateTime -> Effect ZonedDateTime

#with_ Source

with_ :: forall fields rest. Union fields rest WithFields => Record fields -> ZonedDateTime -> Effect ZonedDateTime

#startOfDay Source

startOfDay :: ZonedDateTime -> Effect ZonedDateTime

Returns the start of the calendar day in this time zone.

#getTimeZoneTransition Source

getTimeZoneTransition :: String -> ZonedDateTime -> Maybe ZonedDateTime

Gets the next or previous time zone transition. Direction: "next" or "previous".

#toInstant Source

toInstant :: ZonedDateTime -> Instant

Extracts the absolute instant (no time zone).

#toPlainDateTime Source

toPlainDateTime :: ZonedDateTime -> PlainDateTime

Extracts date and time in the zoned wall-clock view (drops time zone).

#toString Source

toString :: forall provided. ConvertOptionsWithDefaults ToToStringOptions (Record ToStringOptions) (Record provided) (Record ToStringOptions) => Record provided -> ZonedDateTime -> String

Serializes to ISO 8601 format with time zone. Options: calendarName, timeZoneName, offset, fractionalSecondDigits, smallestUnit, roundingMode.

#toString_ Source

toString_ :: ZonedDateTime -> String

Default ISO 8601 serialization (no options). Prefer over toString {}.

Re-exports from JS.Temporal.ZonedDateTime.Internal