https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
j

Jonas Frid

03/09/2022, 9:26 AM
I am using kotlinx.datetime. How do I calculate the difference between two LocalDateTime in years and months?
p

Petter Måhlén

03/09/2022, 9:55 AM
Looks like if you don’t need time, you can do arithmetic based on the LocalDate only? https://github.com/Kotlin/kotlinx-datetime#date-arithmetic. Otherwise, the next section recommends turning into Instant.
🙏 1
3 Views