JS.Temporal.Instant
- Package
- purescript-js-temporal
- Repository
- pete-murphy/purescript-js-temporal
A point in time with nanosecond precision, represented as nanoseconds since the Unix epoch (1970-01-01T00:00:00Z). No time zone or calendar. Use toZonedDateTimeISO to interpret in a time zone.
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/Instant
#fromEpochMilliseconds Source
fromEpochMilliseconds :: Number -> Effect InstantCreates an Instant from epoch milliseconds.
#fromEpochNanoseconds Source
fromEpochNanoseconds :: BigInt -> Effect InstantCreates an Instant from epoch nanoseconds.
#epochMilliseconds Source
epochMilliseconds :: Instant -> Number#epochNanoseconds Source
epochNanoseconds :: Instant -> BigInt#until Source
until :: forall provided. ConvertOptionsWithDefaults ToDifferenceOptions (Record DifferenceOptions) (Record provided) (Record DifferenceOptions) => Record provided -> Instant -> Instant -> Effect DurationReturns the duration from this instant until the other. Options: largestUnit, smallestUnit, roundingIncrement, roundingMode.
#since Source
since :: forall provided. ConvertOptionsWithDefaults ToDifferenceOptions (Record DifferenceOptions) (Record provided) (Record DifferenceOptions) => Record provided -> Instant -> Instant -> Effect DurationReturns the duration from the other instant to this one (inverse of until).
#round Source
round :: forall provided. ConvertOptionsWithDefaults ToRoundOptions (Record RoundOptions) (Record provided) (Record RoundOptions) => Record provided -> Instant -> Effect InstantRounds the instant to the given smallest unit. Options: smallestUnit, roundingIncrement, roundingMode.
#fromDateTimeInstant Source
fromDateTimeInstant :: Instant -> Effect InstantConverts a purescript-datetime Instant to a Temporal Instant.
See docs/purescript-datetime-interop.md.
#toDateTimeInstant Source
toDateTimeInstant :: Instant -> Maybe InstantConverts a Temporal Instant to a purescript-datetime Instant.
Returns Nothing if the value is outside the datetime Instant range.
See docs/purescript-datetime-interop.md.
#toZonedDateTimeISO Source
toZonedDateTimeISO :: String -> Instant -> ZonedDateTimeConverts the instant to a ZonedDateTime in the given time zone (e.g. "America/New_York").
#toString Source
toString :: forall provided. ConvertOptionsWithDefaults ToToStringOptions (Record ToStringOptions) (Record provided) (Record ToStringOptions) => Record provided -> Instant -> StringSerializes the instant to ISO 8601 format. Options: fractionalSecondDigits, smallestUnit, roundingMode, timeZone.
#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 "fractionalSecondDigits" Int ForeignConvertOption ToToStringOptions "fractionalSecondDigits" String ForeignConvertOption ToToStringOptions "smallestUnit" TemporalUnit StringConvertOption ToToStringOptions "smallestUnit" String StringConvertOption ToToStringOptions "roundingMode" RoundingMode StringConvertOption ToToStringOptions "roundingMode" String StringConvertOption ToToStringOptions "timeZone" String String
Re-exports from JS.Temporal.Instant.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