Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Temporal.PlainTime

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.

class PlainTime {
constructor(
hour?: number,
minute?: number,
second?: number,
millisecond?: number,
microsecond?: number,
nanosecond?: number,
);
readonly calendar: Temporal.Calendar;
readonly hour: number;
readonly microsecond: number;
readonly millisecond: number;
readonly minute: number;
readonly nanosecond: number;
readonly second: number;
readonly [Symbol.toStringTag]: "Temporal.PlainTime";
 
add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainTime;
equals(other: Temporal.PlainTime | PlainTimeLike | string): boolean;
getISOFields(): PlainTimeISOFields;
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;
subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainTime;
toJSON(): string;
toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
toPlainDateTime(temporalDate: Temporal.PlainDate | PlainDateLike | string): Temporal.PlainDateTime;
toString(options?: ToStringPrecisionOptions): string;
toZonedDateTime(timeZoneAndDate: {
timeZone: TimeZoneLike;
plainDate: Temporal.PlainDate | PlainDateLike | string;
}
): Temporal.ZonedDateTime;
until(other: Temporal.PlainTime | PlainTimeLike | string, options?: DifferenceOptions<"hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond">): Temporal.Duration;
valueOf(): never;
 
static compare(one: Temporal.PlainTime | PlainTimeLike | string, two: Temporal.PlainTime | PlainTimeLike | string): ComparisonResult;
static from(item: Temporal.PlainTime | PlainTimeLike | string, options?: AssignmentOptions): Temporal.PlainTime;
}

§Constructors

§
new PlainTime(hour?: number, minute?: number, second?: number, millisecond?: number, microsecond?: number, nanosecond?: number)
[src]

§Properties

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

§Methods

§
equals(other: Temporal.PlainTime | PlainTimeLike | string): boolean
[src]
§
getISOFields(): PlainTimeISOFields
[src]
§
round(roundTo: RoundTo<"hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond">): Temporal.PlainTime
[src]
§
since(other: Temporal.PlainTime | PlainTimeLike | string, options?: DifferenceOptions<"hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond">): Temporal.Duration
[src]
§
subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainTime
[src]
§
toJSON(): string
[src]
§
toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string
[src]
§
toPlainDateTime(temporalDate: Temporal.PlainDate | PlainDateLike | string): Temporal.PlainDateTime
[src]
§
toString(options?: ToStringPrecisionOptions): string
[src]
§
toZonedDateTime(timeZoneAndDate: {
timeZone: TimeZoneLike;
plainDate: Temporal.PlainDate | PlainDateLike | string;
}
): Temporal.ZonedDateTime
[src]
§
until(other: Temporal.PlainTime | PlainTimeLike | string, options?: DifferenceOptions<"hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond">): Temporal.Duration
[src]
§
valueOf(): never
[src]

§Static Methods