Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/tsc/dts/lib.deno.unstable.d.ts>Temporal.Duration

A modern runtime for JavaScript and TypeScript.
Latest
class Temporal.Duration
import { Temporal } from "https://deno.land/x/deno@v2.0.4/cli/tsc/dts/lib.deno.unstable.d.ts";
const { Duration } = Temporal;

A Temporal.Duration represents an immutable duration of time which can be used in date/time arithmetic.

See https://tc39.es/proposal-temporal/docs/duration.html for more details.

Constructors

new
Duration(
years?: number,
months?: number,
weeks?: number,
days?: number,
hours?: number,
minutes?: number,
seconds?: number,
milliseconds?: number,
microseconds?: number,
nanoseconds?: number,
)

Properties

readonly
blank: boolean
readonly
days: number
readonly
hours: number
readonly
microseconds: number
readonly
milliseconds: number
readonly
minutes: number
readonly
months: number
readonly
nanoseconds: number
readonly
seconds: number
readonly
sign: -1 | 0 | 1
readonly
weeks: number
readonly
years: number
readonly
[Symbol.toStringTag]: "Temporal.Duration"