-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide the means for a non-default timezone database #201
Comments
Is it correct that the actual issue is only with using non-standard time zone database? If we manage to provide this functionality without 310bp, will the issue still be solved? |
Yes, any way to bundle the time zone database with the app and use it instead of the system tzdb (like 310bp does: https://github.com/ThreeTen/threetenbp/blob/master/src/main/resources/org/threeten/bp/TZDB.dat) would solve the issue. I suggested 310bp because according to https://issuetracker.google.com/issues/159421054#comment3 it's not possible on Android to set time zone data that would be used by |
There are some challenges that providing a possibility to use a custom time zone database will have us to face.
So I would be interested to discuss whether these effects can cause problems in practical aspect, and if they do, if there are ideas how to deal with them. |
Some 2c thoughts!
I don't think this problem is new right? There's always a risk of, say, a server or API sending a zone ID that is newer than what the client understands if it is out of date. If anything I'd expect allowing custom loading to help with this because it would lend more agency to owners to bring their own newer data
Assuming the ID is still just a string ID under the hood, it would be simple enough to just convert over to the java.time.ZoneId right? val zoneId = java.time.ZoneId.of(kotlinxTimeZone.id) |
When developing for Android, developers can use desugaring to enable
java.time
APIs that will be used for kotlinx-datetime implementation on JVM. However, Android doesn't allow developers to provide their own time zone database to be used with those APIs. On APIs 26-28 this means devices will only use time zones provided with the system update (so mostly outdated). On APIs 29+, time zone updates are provided via project mainline, which is supposed to happen regardless of OEM support. However, project mainline depends on Google Play Services infrastructure, which a lot of devices (like Huawei or custom ROMs) don't have. That prevents developers who want to use most recent TZ database from using java.time APIs, and right now that includeskotlinx-datetime
.For that reason, it'd be great to be able to use ThreeTenBP backend with kotlinx-datetime on JVM, ensuring that we can provide most recent time zone database with the app, instead of relying on OEMs or the devices having Google services installed.
See also:
The text was updated successfully, but these errors were encountered: