PlainTime

external class PlainTime(val hour: Int = definedExternally, val minute: Int = definedExternally, val second: Int = definedExternally, val millisecond: Int = definedExternally, val microsecond: Int = definedExternally, val nanosecond: Int = definedExternally) : HasArithmeticOperations<PlainTime, PlainTimeLike, TimeUnit<*>> , Roundable<PlainTime, TimeUnit<*>> , Localizable<DateTimeFormatOptions> (source)

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

Link copied to clipboard
constructor(hour: Int = definedExternally, minute: Int = definedExternally, second: Int = definedExternally, millisecond: Int = definedExternally, microsecond: Int = definedExternally, nanosecond: Int = definedExternally)

Types

Link copied to clipboard

Properties

Link copied to clipboard
val hour: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val minute: Int
Link copied to clipboard
Link copied to clipboard
val second: Int

Functions

Link copied to clipboard
open fun add(duration: Duration, options: ArithmeticOptions = definedExternally): PlainTime
open fun add(duration: DurationLike, options: ArithmeticOptions = definedExternally): PlainTime
open fun add(duration: String, options: ArithmeticOptions = definedExternally): PlainTime
Link copied to clipboard
Link copied to clipboard
open fun round(roundTo: RoundTo<TimeUnit<*>>): PlainTime
open fun round(roundTo: SmallestUnit<TimeUnit<*>>): PlainTime
Link copied to clipboard
open fun since(other: PlainTime, options: DifferenceOptions<TimeUnit<*>>): Duration
open fun since(other: PlainTimeLike, options: DifferenceOptions<TimeUnit<*>>): Duration
open fun since(other: String, options: DifferenceOptions<TimeUnit<*>>): Duration
Link copied to clipboard
open fun subtract(duration: Duration, options: ArithmeticOptions = definedExternally): PlainTime
open fun subtract(duration: DurationLike, options: ArithmeticOptions = definedExternally): PlainTime
open fun subtract(duration: String, options: ArithmeticOptions = definedExternally): PlainTime
Link copied to clipboard
fun toJSON(): String
Link copied to clipboard

Returns a value as a string value appropriate to the host environment's current locale.

open fun toLocaleString(locales: Locale, options: DateTimeFormatOptions = definedExternally): String
open fun toLocaleString(locales: ReadonlyArray<Locale>, options: DateTimeFormatOptions = definedExternally): String
open fun toLocaleString(locales: ReadonlyArray<UnicodeBCP47LocaleIdentifier>, options: DateTimeFormatOptions = definedExternally): String

open fun toLocaleString(locales: UnicodeBCP47LocaleIdentifier, options: DateTimeFormatOptions = definedExternally): String

Converts a value to a string by using the current or specified locale.

Link copied to clipboard
Link copied to clipboard
fun toString(options: ToStringPrecisionOptions = definedExternally): String
Link copied to clipboard
fun toZonedDateTime(timeZoneAndDate: Any): ZonedDateTime
Link copied to clipboard
open fun until(other: PlainTime, options: DifferenceOptions<TimeUnit<*>>): Duration
open fun until(other: PlainTimeLike, options: DifferenceOptions<TimeUnit<*>>): Duration
open fun until(other: String, options: DifferenceOptions<TimeUnit<*>>): Duration
Link copied to clipboard
fun with(timeLike: PlainTime, options: AssignmentOptions = definedExternally): PlainTime