Skip to main content

Kotlinx DateTime Gens

Kotest provides an optional module that provides generators for KotlinX DateTime.


To use, add io.kotest.extensions:kotest-property-datetime:version to your build.

GeneratorDescriptionJVMJSNative LocalDates with the year between the given range and other fields randomly.โœ“โœ“โœ“
Arb.datetime(yearRange, hourRange, minuteRange, secondRage)Generates LocalDateTimes with all fields in the given rangesโœ“โœ“โœ“
Arb.instant(range)Generates Instants with the epoch randomly generated in the given rangeโœ“โœ“โœ“