class LocalDateTime
source · line 14public class LocalDateTime public constructor(
/**
* The calendar-date component.
*/
public val date: LocalDate,
/**
* The local-time component.
*/
public val time: LocalTime) : Equals<LocalDateTime>, Compare<LocalDateTime>, Hash, ToString, Add<Duration, LocalDateTime>, Sub<Duration, LocalDateTime>
- Supertype
Equals<LocalDateTime> - Supertype
Compare<LocalDateTime> - Supertype
Hash - Supertype
ToString - Supertype
Add<Duration, LocalDateTime> - Supertype
Sub<Duration, LocalDateTime>
An immutable local date and time without a time zone. Conversion to an Instant requires an explicit UTC offset.
function minus
source · line 63public override operator fun minus(other: Duration): LocalDateTime
- Overrides
minus
Subtracts the supplied elapsed or calendar amount. Calendar components are applied before time components; fixed-duration overflow carries into the date.
parameter other
source · line 63other: Duration
property minute
source · line 45public val minute: Int
get: public read-only
The minute within the hour in 0..59.
getter get
source · line 45get(): Int
function plus
source · line 58public override operator fun plus(other: Duration): LocalDateTime
- Overrides
plus
Adds the supplied elapsed or calendar amount. Calendar components are applied before time components; fixed-duration overflow carries into the date.
parameter other
source · line 58other: Duration
function hash
source · line 105public override fun hash(): Long
- Overrides
hash
Computes a hash consistent with component equality.
property time
source · line 22public val time: LocalTime
get: public read-only
The local-time component.
function compareTo
source · line 100public override operator fun compareTo(other: LocalDateTime): Long
- Overrides
compareTo
Orders values by their chronological or numeric value; only the result sign is significant.
parameter other
source · line 100other: LocalDateTime
property monthNumber
source · line 33public val monthNumber: Int
get: public read-only
The one-based month number in 1..12.
getter get
source · line 33get(): Int
function minus
source · line 77public operator fun minus(other: DatePeriod): LocalDateTime
Subtracts the supplied elapsed or calendar amount. Calendar components are applied before time components; fixed-duration overflow carries into the date.
parameter other
source · line 77other: DatePeriod
property nanosecond
source · line 53public val nanosecond: Int
get: public read-only
The fractional nanosecond within the second in 0..999999999.
getter get
source · line 53get(): Int
constructor constructor
source · line 24constructor(year: Int, monthNumber: Int, dayOfMonth: Int, hour: Int, minute: Int, second: Int = 0, nanosecond: Int = 0)
parameter second
source · line 24second: Int = 0
parameter monthNumber
source · line 24monthNumber: Int
parameter nanosecond
source · line 24nanosecond: Int = 0
parameter dayOfMonth
source · line 24dayOfMonth: Int
parameter year
source · line 24year: Int
parameter hour
source · line 24hour: Int
parameter minute
source · line 24minute: Int
property date
source · line 18public val date: LocalDate
get: public read-only
The calendar-date component.
constructor constructor
source · line 14constructor(public val date: LocalDate, public val time: LocalTime)
parameter time
source · line 22public val time: LocalTime
parameter date
source · line 18public val date: LocalDate
property hour
source · line 41public val hour: Int
get: public read-only
The hour of day in 0..23.
getter get
source · line 41get(): Int
property dayOfMonth
source · line 37public val dayOfMonth: Int
get: public read-only
The one-based day within the validated month.
getter get
source · line 37get(): Int
function plus
source · line 82public operator fun plus(other: DateTimePeriod): LocalDateTime
Adds the supplied elapsed or calendar amount. Calendar components are applied before time components; fixed-duration overflow carries into the date.
parameter other
source · line 82other: DateTimePeriod
function toString
source · line 109public override fun toString(): String
- Overrides
toString
Formats this value as ISO local date-time with a T separator.
function minus
source · line 87public operator fun minus(other: DateTimePeriod): LocalDateTime
Subtracts the supplied elapsed or calendar amount. Calendar components are applied before time components; fixed-duration overflow carries into the date.
parameter other
source · line 87other: DateTimePeriod
property year
source · line 29public val year: Int
get: public read-only
The proleptic Gregorian year, including year zero.
getter get
source · line 29get(): Int
property second
source · line 49public val second: Int
get: public read-only
The second within the minute in 0..59.
getter get
source · line 49get(): Int
function plus
source · line 72public operator fun plus(other: DatePeriod): LocalDateTime
Adds the supplied elapsed or calendar amount. Calendar components are applied before time components; fixed-duration overflow carries into the date.
parameter other
source · line 72other: DatePeriod
function toInstant
source · line 91public fun toInstant(offset: UtcOffset): Instant
Interprets this local date-time at the explicitly supplied fixed UTC offset.
parameter offset
source · line 91offset: UtcOffset
function equals
source · line 96public override operator fun equals(other: LocalDateTime): Boolean
- Overrides
equals
Compares the stored value components for equality.
parameter other
source · line 96other: LocalDateTime