Closed as not planned
Description
When I was learning Kotlin, I made a JVM application that utilized the java.time.LocalTime class a lot, and it was convenient to use the truncateTo() method to only have hours and minutes. I'm now rewriting the application in Kotlin Native to get even more experience with the language, and I'm learning that to shave off seconds, I need to have an extra variable to truncate a LocalTime:
/**
* The current system time, with seconds and nanoseconds
*/
private val untrimmedNow: LocalTime = Clock.System.now()
.toLocalDateTime(TimeZone.currentSystemDefault()).time
/**
* The current system time without seconds.
*/
val NOW: LocalTime = LocalTime(untrimmedNow.hour, untrimmedNow.minute)
While this works, I'd much rather only have to add one more line, something like .truncateTo(DateTimeUnit.SECOND)
.