Thanks for your response @Stylianos Gakis
When I tried this code below:
Copy code
val dt1= LocalDate(2024,5,15)
val dt2 = LocalDate(2024,2,23)
val rdf = dt1.minus(dt2)
println(rdf)
What I get in the console is: P2M22D , which I think must be referring to 2 months, 22 days. However, that is not an absolute number, since two months could mean different for different months. How do I get it in absolute days?
well, the property 'days' don't give that. That only provides the days as in remainder days after month. In this case, 22 days after 2 months. However, I saw couple of functions there i.e., daysUntil/until which provided the right answer 82 days.
Copy code
val dt1= LocalDate(2024,5,15)
val dt2 = LocalDate(2024,2,23)
val rdf = dt2.daysUntil(dt1)
val rdf2 = dt2.daysUntil(dt1)
println(rdf)
Now it prints 82.
Thank you @Stylianos Gakis so much for guiding & pointing to the right source. This helped me a lot!
🌟 1
s
Stylianos Gakis
05/20/2024, 9:38 AM
That only provides the days as in remainder days after month
Ah I see, it was a guess after all 😅
Awesome to see it work!