PlainDateTime

external class PlainDateTime(isoYear: Int, isoMonth: Int, isoDay: Int, hour: Int = definedExternally, minute: Int = definedExternally, second: Int = definedExternally, millisecond: Int = definedExternally, microsecond: Int = definedExternally, nanosecond: Int = definedExternally, calendar: CalendarLike = definedExternally) : HasArithmeticOperations<PlainDateTime, PlainDateTimeLike, DateTimeUnit<*>> , Roundable<PlainDateTime, DateTimeUnit<*>> , Localizable<DateTimeFormatOptions> , CalendarLike(source)

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

Link copied to clipboard
constructor(isoYear: Int, isoMonth: Int, isoDay: Int, hour: Int = definedExternally, minute: Int = definedExternally, second: Int = definedExternally, millisecond: Int = definedExternally, microsecond: Int = definedExternally, nanosecond: Int = definedExternally, calendar: CalendarLike = definedExternally)

Types

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
val day: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val era: String?
Link copied to clipboard
val eraYear: Int?
Link copied to clipboard
val hour: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val minute: Int
Link copied to clipboard
val month: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val second: Int
Link copied to clipboard
Link copied to clipboard
val year: Int
Link copied to clipboard

Functions

Link copied to clipboard
open fun add(duration: Duration, options: ArithmeticOptions = definedExternally): PlainDateTime
open fun add(duration: DurationLike, options: ArithmeticOptions = definedExternally): PlainDateTime
open fun add(duration: String, options: ArithmeticOptions = definedExternally): PlainDateTime
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun round(roundTo: RoundTo<DateTimeUnit<*>>): PlainDateTime
Link copied to clipboard
open fun since(other: String, options: DifferenceOptions<DateTimeUnit<*>>): Duration
Link copied to clipboard
open fun subtract(duration: Duration, options: ArithmeticOptions = definedExternally): PlainDateTime
open fun subtract(duration: DurationLike, options: ArithmeticOptions = definedExternally): PlainDateTime
open fun subtract(duration: String, options: ArithmeticOptions = definedExternally): PlainDateTime
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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun toString(options: CalendarTypeToStringOptions = definedExternally): String
Link copied to clipboard
fun toZonedDateTime(tzLike: TimeZoneLike, options: ToInstantOptions = definedExternally): ZonedDateTime
Link copied to clipboard
open fun until(other: String, options: DifferenceOptions<DateTimeUnit<*>>): Duration
Link copied to clipboard
fun with(dateTimeLike: PlainDateTimeLike, options: AssignmentOptions = definedExternally): PlainDateTime
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun withPlainTime(timeLike: PlainTime = definedExternally): PlainDateTime