Skip to content

//core/io.islandtime/truncatedTo

truncatedTo

common

fun Time.truncatedTo(unit: TimeUnit): Time

fun OffsetTime.truncatedTo(unit: TimeUnit): OffsetTime

Returns this time, rounded down to match the precision of a given unit.

This is equivalent to roundedDownTo.

common

fun DateTime.truncatedTo(unit: TimeUnit): DateTime

fun OffsetDateTime.truncatedTo(unit: TimeUnit): OffsetDateTime

fun ZonedDateTime.truncatedTo(unit: TimeUnit): ZonedDateTime

Returns this date-time, rounded down to match the precision of a given unit.

This is equivalent to roundedDownTo.

common

fun Instant.truncatedTo(unit: TimeUnit): Instant

Returns this instant, rounded down to match the precision of a given unit.

This is equivalent to roundedDownTo.