docs.rodeo

MDN Web Docs mirror

Temporal.PlainTime

{{JSRef}} {{SeeCompatTable}} 

The Temporal.PlainTime object represents a time without a date or time zone; for example, a recurring event that happens at the same time every day. It is fundamentally represented as a combination of hour, minute, second, millisecond, microsecond, and nanosecond values.

Description

A PlainTime is essentially the time part of a {{jsxref("Temporal.PlainDateTime")}}  object, with the date information removed. Because the date and time information don’t have much interaction, all general information about time properties is documented here.

RFC 9557 format

PlainTime objects can be serialized and parsed using the RFC 9557 format, an extension to the ISO 8601 / RFC 3339 format. The string has the following form:

HH:mm:ss.sssssssss

As an input, you may optionally include the date, offset, time zone identifier, and calendar, in the same format as PlainDateTime, but they will be ignored. A date-only string will be rejected. Other annotations in the [key=value] format are also ignored, and they must not have the critical flag.

When serializing, you can configure the fractional second digits.

Constructor

Static methods

Instance properties

These properties are defined on Temporal.PlainTime.prototype and shared by all Temporal.PlainTime instances.

Instance methods

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN