times

open operator override fun times(scalar: Int): DateTimeUnit.TimeBased(source)

Produces a datetime unit that is a multiple of this unit times the specified integer scalar value.

Throws

if the result overflows.

Samples

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

fun main() { 
   //sampleStart 
   // Obtaining a measurement unit that's several times larger than another one
val twoWeeks = DateTimeUnit.WEEK * 2
check(twoWeeks.days == 14) 
   //sampleEnd
}