what is the best practice around using dates in Kotlin. Should we avoid using the Java Date or Calendar classes? What is the replacement for this? Are there any good blog posts around this topic?
Use java.time if you have it, if you don’t use Date
Yes, it’s the best choice if you target not only newest Androids and you heavily use date/calendar API
m
Matej Drobnič
06/11/2019, 6:43 AM
Date and Calendar are fine if you are only dealing with fixed points in time (e.g exact date and time in exact timezone), but once you stray away from that, it becomes a pain
➕ 1
For example, just displaying dates and time to the user, regardless of the timezone is a pain in Date/Calendar world