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

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

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

A Temporal.PlainTime represents a wall-clock time, with a precision in nanoseconds, and without any time zone. "Wall-clock time" refers to the concept of a time as expressed in everyday usage — the time that you read off the clock on the wall. For example, it could be used to represent an event that happens daily at a certain time, no matter what time zone.

Temporal.PlainTime refers to a time with no associated calendar date; if you need to refer to a specific time on a specific day, use Temporal.PlainDateTime. A Temporal.PlainTime can be converted into a Temporal.PlainDateTime by combining it with a Temporal.PlainDate using the toPlainDateTime() method.

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

Constructors

new
PlainTime(
hour?: number,
minute?: number,
second?: number,
millisecond?: number,
microsecond?: number,
nanosecond?: number,
)

Properties

readonly
hour: number
readonly
microsecond: number
readonly
millisecond: number
readonly
minute: number
readonly
nanosecond: number
readonly
second: number
readonly
[Symbol.toStringTag]: "Temporal.PlainTime"

Methods

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