core / io.islandtime.operators / roundedDownTo

roundedDownTo

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Time.roundedDownTo(unit: TimeUnit): Time
fun OffsetTime.roundedDownTo(unit: TimeUnit): OffsetTime

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

This is equivalent to truncatedTo.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateTime.roundedDownTo(unit: TimeUnit): DateTime
fun OffsetDateTime.roundedDownTo(unit: TimeUnit): OffsetDateTime

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

This is equivalent to truncatedTo.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTime.roundedDownTo(unit: TimeUnit): ZonedDateTime

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

Due to daylight savings time transitions, there a few complexities to be aware of. If the new local time falls within a gap (meaning it doesn't exist), it will be adjusted forward by the length of the gap. If it falls within an overlap (meaning the local time exists twice), the offset will be retained if possible. Otherwise, the earlier offset will be used.

This is equivalent to truncatedTo.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Instant.roundedDownTo(unit: TimeUnit): Instant

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

This is equivalent to truncatedTo.