class LocalTime
source · line 11public class LocalTime public constructor(
/**
* The hour of day in 0..23.
*/
public val hour: Int,
/**
* The minute within the hour in 0..59.
*/
public val minute: Int,
/**
* The second within the minute in 0..59.
*/
public val second: Int = 0,
/**
* The fractional nanosecond within the second in 0..999999999.
*/
public val nanosecond: Int = 0
) : Equals<LocalTime>, Compare<LocalTime>, Hash, ToString, Add<Duration, LocalTime>, Sub<Duration, LocalTime>
- Supertype
Equals<LocalTime> - Supertype
Compare<LocalTime> - Supertype
Hash - Supertype
ToString - Supertype
Add<Duration, LocalTime> - Supertype
Sub<Duration, LocalTime>
An immutable time of day with nanosecond precision. Hours are 0..23, minutes/seconds 0..59, and nanoseconds 0..999999999; leap seconds are not represented.
property hour
source · line 15public val hour: Int
get: public read-only
The hour of day in 0..23.
constructor constructor
source · line 11constructor(public val hour: Int, public val minute: Int, public val second: Int = 0, public val nanosecond: Int = 0)
parameter hour
source · line 15public val hour: Int
parameter nanosecond
source · line 27public val nanosecond: Int = 0
parameter minute
source · line 19public val minute: Int
parameter second
source · line 23public val second: Int = 0
function toNanosecondOfDay
source · line 36public fun toNanosecondOfDay(): Long
Returns nanoseconds since midnight in 0..<86400000000000.
property second
source · line 23public val second: Int = 0
get: public read-only
The second within the minute in 0..59.
function plus
source · line 41public override operator fun plus(other: Duration): LocalTime
- Overrides
plus
Adds a duration and wraps across midnight, discarding whole days.
parameter other
source · line 41other: Duration
function equals
source · line 51public override operator fun equals(other: LocalTime): Boolean
- Overrides
equals
Compares the stored value components for equality.
parameter other
source · line 51other: LocalTime
function minus
source · line 46public override operator fun minus(other: Duration): LocalTime
- Overrides
minus
Subtracts a duration and wraps across midnight, discarding whole days.
parameter other
source · line 46other: Duration
function hash
source · line 60public override fun hash(): Long
- Overrides
hash
Computes a hash consistent with component equality.
property nanosecond
source · line 27public val nanosecond: Int = 0
get: public read-only
The fractional nanosecond within the second in 0..999999999.
property minute
source · line 19public val minute: Int
get: public read-only
The minute within the hour in 0..59.
function toString
source · line 64public override fun toString(): String
- Overrides
toString
Formats this value as ISO local time.
function compareTo
source · line 56public override operator fun compareTo(other: LocalTime): Long
- Overrides
compareTo
Orders values by their chronological or numeric value; only the result sign is significant.
parameter other
source · line 56other: LocalTime