core / io.islandtime.ranges / randomOrNull

randomOrNull

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateRange.randomOrNull(): Date?

Return a random date within the range using the default random number generator or null if the range is empty or unbounded.

See Also

DateRange.random

(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateRange.randomOrNull(random: <ERROR CLASS>): Date?

Return a random date within the range using the supplied random number generator or null if the range is empty or unbounded.

See Also

DateRange.random

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateTimeInterval.randomOrNull(): DateTime?

Return a random date-time within the interval using the default random number generator or null if the interval is empty or unbounded.

See Also

DateTimeInterval.random

(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateTimeInterval.randomOrNull(random: <ERROR CLASS>): DateTime?

Return a random date-time within the interval using the supplied random number generator or null if the interval is empty or unbounded.

See Also

DateTimeInterval.random

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun InstantInterval.randomOrNull(): Instant?

Return a random instant within the interval using the default random number generator or null if the interval is empty or unbounded.

See Also

InstantInterval.random

(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun InstantInterval.randomOrNull(random: <ERROR CLASS>): Instant?

Return a random instant within the interval using the supplied random number generator or null if the interval is empty or unbounded.

See Also

InstantInterval.random

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTimeInterval.randomOrNull(): OffsetDateTime?

Return a random date-time within the interval using the default random number generator or null if the interval is empty or unbounded. The offset of the start date-time will be used.

See Also

OffsetDateTimeInterval.random

(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTimeInterval.randomOrNull(random: <ERROR CLASS>): OffsetDateTime?

Return a random date-time within the interval using the supplied random number generator or null if the interval is empty or unbounded. The offset of the start date-time will be used.

See Also

OffsetDateTimeInterval.random

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTimeInterval.randomOrNull(): ZonedDateTime?

Return a random date-time within the interval using the default random number generator or null if the interval is empty or unbounded. The zone of the start date-time will be used.

See Also

ZonedDateTimeInterval.random

(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTimeInterval.randomOrNull(random: <ERROR CLASS>): ZonedDateTime?

Return a random date-time within the interval using the supplied random number generator or null if the interval is empty or unbounded. The zone of the start date-time will be used.

See Also

ZonedDateTimeInterval.random

(jvm) fun DateRange.randomOrNull(random: Random): Date?

Return a random date within the range using the supplied random number generator or null if the range is empty or unbounded.

See Also

DateRange.random

(jvm) fun DateTimeInterval.randomOrNull(random: Random): DateTime?

Return a random date-time within the interval using the supplied random number generator or null if the interval is empty or unbounded.

See Also

DateTimeInterval.random

(jvm) fun InstantInterval.randomOrNull(random: Random): Instant?

Return a random instant within the interval using the supplied random number generator or null if the interval is empty or unbounded.

See Also

InstantInterval.random

(jvm) fun OffsetDateTimeInterval.randomOrNull(random: Random): OffsetDateTime?

Return a random date-time within the interval using the supplied random number generator or null if the interval is empty or unbounded. The offset of the start date-time will be used.

See Also

OffsetDateTimeInterval.random

(jvm) fun ZonedDateTimeInterval.randomOrNull(random: Random): ZonedDateTime?

Return a random date-time within the interval using the supplied random number generator or null if the interval is empty or unbounded. The zone of the start date-time will be used.

See Also

ZonedDateTimeInterval.random