Skip to content

google/android-chrono-tz

android-chrono-tz

crates.io page docs.rs page

This crates provides a chrono TimeZone implementation to correctly fetch the local timezone on Android, using the localtime_rz and mktime_z functions from Bionic.

Unlike localtime and mktime these functions are fully thread-safe. They were added in Android 15 (API level 35) so won't work in earlier Android versions. If you're using this crate in an Android app then ensure your minSdk is set to 35 or higher.

It also provides access to arbitrary timezones from the system timezone database, by Olson ID.

This is not an officially supported Google product. This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.

Development

Install the Android NDK and cargo-ndk, e.g.:

$ sudo apt install google-android-ndk-r28c-installer
$ cargo install cargo-ndk
$ rustup target add aarch64-linux-android

To run tests on a connected Android device:

$ CARGO_NDK_PLATFORM=35 ANDROID_NDK_HOME=/usr/lib/android-ndk cargo ndk test --target aarch64-linux-android

License

Licensed under either of

at your option.

Contributing

If you want to contribute to the project, see details of how we accept contributions.

About

No description, website, or topics provided.

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages