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

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

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

A Temporal.PlainDateTime represents a calendar date and wall-clock time, with a precision in nanoseconds, and without any time zone. Of the Temporal classes carrying human-readable time information, it is the most general and complete one. Temporal.PlainDate, Temporal.PlainTime, Temporal.PlainYearMonth, and Temporal.PlainMonthDay all carry less information and should be used when complete information is not required.

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

Constructors

new
PlainDateTime(
isoYear: number,
isoMonth: number,
isoDay: number,
hour?: number,
minute?: number,
second?: number,
millisecond?: number,
microsecond?: number,
nanosecond?: number,
calendar?: string,
)

Properties

readonly
calendarId: string
readonly
day: number
readonly
dayOfWeek: number
readonly
dayOfYear: number
readonly
daysInMonth: number
readonly
daysInWeek: number
readonly
daysInYear: number
readonly
era: string | undefined
readonly
eraYear: number | undefined
readonly
hour: number
readonly
inLeapYear: boolean
readonly
microsecond: number
readonly
millisecond: number
readonly
minute: number
readonly
month: number
readonly
monthCode: string
readonly
monthsInYear: number
readonly
nanosecond: number
readonly
second: number
readonly
weekOfYear: number | undefined
readonly
year: number
readonly
yearOfWeek: number | undefined
readonly
[Symbol.toStringTag]: "Temporal.PlainDateTime"

Methods

equals(other: Temporal.PlainDateTime | PlainDateTimeLike | string): boolean
round(roundTo: RoundTo<
| "day"
| "hour"
| "minute"
| "second"
| "millisecond"
| "microsecond"
| "nanosecond"
>
): Temporal.PlainDateTime
since(other: Temporal.PlainDateTime | PlainDateTimeLike | string, options?: DifferenceOptions<
| "year"
| "month"
| "week"
| "day"
| "hour"
| "minute"
| "second"
| "millisecond"
| "microsecond"
| "nanosecond"
>
): Temporal.Duration
toJSON(): string
toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string
until(other: Temporal.PlainDateTime | PlainDateTimeLike | string, options?: DifferenceOptions<
| "year"
| "month"
| "week"
| "day"
| "hour"
| "minute"
| "second"
| "millisecond"
| "microsecond"
| "nanosecond"
>
): Temporal.Duration
valueOf(): never