nanosecondsOfSecond

The number of nanoseconds by which this instant is later than epochSeconds from the epoch instant.

The value is always non-negative and lies in the range 0..999_999_999.

See also

Samples

import kotlinx.datetime.*
import kotlinx.datetime.format.*
import kotlin.random.*
import kotlin.test.*
import kotlin.time.Duration.Companion.hours

fun main() { 
   //sampleStart 
   // Getting the number of nanoseconds that passed since the start of the second
val instant1 = Instant.fromEpochSeconds(999_999, nanosecondAdjustment = 123_456_789)
check(instant1.nanosecondsOfSecond == 123_456_789)
val instant2 = Instant.fromEpochSeconds(1_000_000, nanosecondAdjustment = 100_123_456_789)
check(instant2.nanosecondsOfSecond == 123_456_789)
val instant3 = Instant.fromEpochSeconds(1_000_000, nanosecondAdjustment = -100_876_543_211)
check(instant3.nanosecondsOfSecond == 123_456_789) 
   //sampleEnd
}