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.
#new Source
new :: BigInt -> String -> Effect ZonedDateTimeCreates 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 ZonedDateTimeParses an ISO 8601 string with time zone (e.g. "2024-01-15T12:00-05:00[America/New_York]"). Options: overflow, disambiguation, offset.
#year Source
year :: ZonedDateTime -> Int#month Source
month :: ZonedDateTime -> Int#day Source
day :: ZonedDateTime -> Int#monthCode Source
monthCode :: ZonedDateTime -> String#hour Source
hour :: ZonedDateTime -> Int#minute Source
minute :: ZonedDateTime -> Int#second Source
second :: ZonedDateTime -> Int#millisecond Source
millisecond :: ZonedDateTime -> Int#microsecond Source
microsecond :: ZonedDateTime -> Int#nanosecond Source
nanosecond :: ZonedDateTime -> Int#dayOfWeek Source
dayOfWeek :: ZonedDateTime -> Int#dayOfYear Source
dayOfYear :: ZonedDateTime -> Int#weekOfYear Source
weekOfYear :: ZonedDateTime -> Maybe Int#yearOfWeek Source
yearOfWeek :: ZonedDateTime -> Maybe Int#daysInMonth Source
daysInMonth :: ZonedDateTime -> Int#daysInYear Source
daysInYear :: ZonedDateTime -> Int#daysInWeek Source
daysInWeek :: ZonedDateTime -> Int#monthsInYear Source
monthsInYear :: ZonedDateTime -> Int#inLeapYear Source
inLeapYear :: ZonedDateTime -> Boolean#calendarId Source
calendarId :: ZonedDateTime -> String#timeZoneId Source
timeZoneId :: ZonedDateTime -> String#offset Source
offset :: ZonedDateTime -> String#hoursInDay Source
hoursInDay :: ZonedDateTime -> Int#add Source
add :: forall provided. ConvertOptionsWithDefaults ToArithmeticOptions (Record ArithmeticOptions) (Record provided) (Record ArithmeticOptions) => Record provided -> Duration -> ZonedDateTime -> Effect ZonedDateTimeAdds a duration. Supports calendar durations. Options: overflow.
#add_ Source
add_ :: Duration -> ZonedDateTime -> Effect ZonedDateTimeSame as add with default options.
#subtract Source
subtract :: forall provided. ConvertOptionsWithDefaults ToArithmeticOptions (Record ArithmeticOptions) (Record provided) (Record ArithmeticOptions) => Record provided -> Duration -> ZonedDateTime -> Effect ZonedDateTime#subtract_ Source
subtract_ :: Duration -> ZonedDateTime -> Effect ZonedDateTime#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#withTimeZone Source
withTimeZone :: String -> ZonedDateTime -> Effect ZonedDateTime#withCalendar Source
withCalendar :: String -> ZonedDateTime -> Effect ZonedDateTime#until Source
until :: forall provided. ConvertOptionsWithDefaults ToDifferenceOptions (Record DifferenceOptions) (Record provided) (Record DifferenceOptions) => Record provided -> ZonedDateTime -> ZonedDateTime -> Effect Duration#until_ Source
until_ :: ZonedDateTime -> ZonedDateTime -> Effect Duration#since Source
since :: forall provided. ConvertOptionsWithDefaults ToDifferenceOptions (Record DifferenceOptions) (Record provided) (Record DifferenceOptions) => Record provided -> ZonedDateTime -> ZonedDateTime -> Effect Duration#since_ Source
since_ :: ZonedDateTime -> ZonedDateTime -> Effect Duration#round Source
round :: forall provided. ConvertOptionsWithDefaults ToRoundOptions (Record RoundOptions) (Record provided) (Record RoundOptions) => Record provided -> ZonedDateTime -> Effect ZonedDateTime#startOfDay Source
startOfDay :: ZonedDateTime -> Effect ZonedDateTimeReturns the start of the calendar day in this time zone.
#getTimeZoneTransition Source
getTimeZoneTransition :: String -> ZonedDateTime -> Maybe ZonedDateTimeGets the next or previous time zone transition. Direction: "next" or "previous".
#toInstant Source
toInstant :: ZonedDateTime -> InstantExtracts the absolute instant (no time zone).
#toPlainDateTime Source
toPlainDateTime :: ZonedDateTime -> PlainDateTimeExtracts 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 -> StringSerializes to ISO 8601 format with time zone. Options: calendarName, timeZoneName, offset, fractionalSecondDigits, smallestUnit, roundingMode.
#toString_ Source
toString_ :: ZonedDateTime -> StringDefault ISO 8601 serialization (no options). Prefer over toString {}.
#ToFromOptions Source
data ToFromOptionsInstances
ConvertOption ToFromOptions "overflow" Overflow StringConvertOption ToFromOptions "overflow" String StringConvertOption ToFromOptions "disambiguation" Disambiguation StringConvertOption ToFromOptions "disambiguation" String StringConvertOption ToFromOptions "offset" OffsetDisambiguation StringConvertOption ToFromOptions "offset" String String
#ToArithmeticOptions Source
data ToArithmeticOptionsInstances
ConvertOption ToArithmeticOptions "overflow" Overflow StringConvertOption ToArithmeticOptions "overflow" String StringConvertOption ToArithmeticOptions "disambiguation" Disambiguation StringConvertOption ToArithmeticOptions "disambiguation" String String
#ToDifferenceOptions Source
data ToDifferenceOptionsInstances
ConvertOption ToDifferenceOptions "largestUnit" TemporalUnit StringConvertOption ToDifferenceOptions "largestUnit" String StringConvertOption ToDifferenceOptions "smallestUnit" TemporalUnit StringConvertOption ToDifferenceOptions "smallestUnit" String StringConvertOption ToDifferenceOptions "roundingIncrement" Int IntConvertOption ToDifferenceOptions "roundingMode" RoundingMode StringConvertOption ToDifferenceOptions "roundingMode" String String
#ToRoundOptions Source
data ToRoundOptionsInstances
ConvertOption ToRoundOptions "smallestUnit" TemporalUnit StringConvertOption ToRoundOptions "smallestUnit" String StringConvertOption ToRoundOptions "roundingIncrement" Int IntConvertOption ToRoundOptions "roundingMode" RoundingMode StringConvertOption ToRoundOptions "roundingMode" String String
#ToToStringOptions Source
data ToToStringOptionsInstances
ConvertOption ToToStringOptions "calendarName" CalendarName StringConvertOption ToToStringOptions "calendarName" String StringConvertOption ToToStringOptions "timeZoneName" String StringConvertOption ToToStringOptions "offset" String StringConvertOption ToToStringOptions "fractionalSecondDigits" Int ForeignConvertOption ToToStringOptions "fractionalSecondDigits" String ForeignConvertOption ToToStringOptions "smallestUnit" TemporalUnit StringConvertOption ToToStringOptions "smallestUnit" String StringConvertOption ToToStringOptions "roundingMode" RoundingMode StringConvertOption ToToStringOptions "roundingMode" String String
Re-exports from JS.Temporal.ZonedDateTime.Internal
- Modules
- JS.
Temporal. CalendarName - JS.
Temporal. Disambiguation - JS.
Temporal. Duration - JS.
Temporal. Duration. Internal - JS.
Temporal. Instant - JS.
Temporal. Instant. Internal - JS.
Temporal. Internal - JS.
Temporal. Now - JS.
Temporal. OffsetDisambiguation - JS.
Temporal. Overflow - JS.
Temporal. PlainDate - JS.
Temporal. PlainDate. Internal - JS.
Temporal. PlainDateTime - JS.
Temporal. PlainDateTime. Internal - JS.
Temporal. PlainMonthDay - JS.
Temporal. PlainMonthDay. Internal - JS.
Temporal. PlainTime - JS.
Temporal. PlainTime. Internal - JS.
Temporal. PlainYearMonth - JS.
Temporal. PlainYearMonth. Internal - JS.
Temporal. RoundingMode - JS.
Temporal. TemporalUnit - JS.
Temporal. ZonedDateTime - JS.
Temporal. ZonedDateTime. Internal