temporal-fns
    Preparing search index...

    Function fromDate

    • Converts a legacy Date to a Temporal value.

      Without a timeZone, returns a Temporal.Instant — the time-zone-free representation of the absolute moment the Date refers to. Pass a timeZone to anchor the instant in a specific zone and get a Temporal.ZonedDateTime back. To get a PlainDate or PlainDateTime, chain the zoned conversion: fromDate(date, tz).toPlainDate().

      Parameters

      • date: Date

      Returns Instant

    • Converts a legacy Date to a Temporal value.

      Without a timeZone, returns a Temporal.Instant — the time-zone-free representation of the absolute moment the Date refers to. Pass a timeZone to anchor the instant in a specific zone and get a Temporal.ZonedDateTime back. To get a PlainDate or PlainDateTime, chain the zoned conversion: fromDate(date, tz).toPlainDate().

      Parameters

      • date: Date
      • timeZone: TimeZoneLike

      Returns ZonedDateTime