Arithmetics
Add, subtract times and convert among different time units painlessly.
val now = KInstant.now()
val tomorrow = now + 1.days()
val dateTime = KZonedDateTime(
year = 2024,
month = 1,
day = 1,
hour = 1,
minute = 8,
second = 40,
zoneOffset = KZoneOffset.parseFrom("+08:00")
)
val yesterday = dateTime - 1.days()
The difference between two time instants is a duration.