DateComponents

data class DateComponents(val mode: DateComponents.Mode = Mode.DATE, val years: Int = 0, val months: Int = 0, val days: Int = 0, val hours: Int = 0, val minutes: Int = 0, val seconds: Int = 0, val nanoseconds: Int = 0, val offset: Duration? = null, val sign: Int = +1, val isTime: Boolean = false)

Constructors

Link copied to clipboard
constructor(mode: DateComponents.Mode = Mode.DATE, years: Int = 0, months: Int = 0, days: Int = 0, hours: Int = 0, minutes: Int = 0, seconds: Int = 0, nanoseconds: Int = 0, offset: Duration? = null, sign: Int = +1, isTime: Boolean = false)

Types

Link copied to clipboard

Properties

Link copied to clipboard

When parsing time without dates, hours shouldn't be clamped

Link copied to clipboard
val date: Date
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val days: Int

For dates, days is the day in the month []1..31]

Link copied to clipboard
val hours: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

How properties must be interpreted

Link copied to clipboard
val months: Int

For dates, months is 1..12

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val sign: Int
Link copied to clipboard
Link copied to clipboard
val years: Int

For dates, years is the full year. For example 1970 or 2024

Functions

Link copied to clipboard
Link copied to clipboard
fun DateComponents.toDateTimeTz(doThrow: Boolean = false, doAdjust: Boolean = true): DateTimeTz?
Link copied to clipboard