JakeWharton / ThreeTenABP

An adaptation of the JSR-310 backport for Android.
Apache License 2.0
3.55k stars 133 forks source link

Please *do not* consider switching to core library desugaring #138

Closed filipebrandao closed 1 year ago

filipebrandao commented 1 year ago

I just want make people aware that this project should still be standard and encouraged for date and time apis in Android. Specially for date/time sensitive apps across different timezones.

My experience with using ZonedDateTime with core library desugaring was not so good. Personally I decided to not use TrheeTenABP because of this statement in the README which sounded totally fair:

Attention: Development on this library is winding down. Please consider switching to Android Gradle plugin 4.0, java.time.*, and its core library desugaring feature in the coming months.

By following the desugaring path, I had issues because of outdated timezones database in older devices. One example is the timezone America/Sao_Paulo where DST was abolished in Brazil back in 2019 but so many devices are still not aware of timezone changes and will never be. But ThreeTen provides updated timezones database and fixes this issue in any device.

Folks at kotlinx-datetime also face the same problems and that's why I think the usage of this ThreeTenABP project should still be encouraged for date and time apis in Android.

JakeWharton commented 1 year ago

Desugaring supports shipping a custom tzdb the same way this library does. The only difference is now you are responsible for updating it rather than me.

filipebrandao commented 1 year ago

Further note for people falling in this same issues who still want to keep using google's unofficial desugaring lib: There's a project that accomplishes Jake's suggestion and can be a good starting point https://github.com/ZacSweers/ticktock

Personally, given the option, I would still consider using ThreeTenABP instead.