.cargo/vendor/android_system_properties/examples/time_zone.rs
raw| 1 | /// Prints the current time zone, e.g. "Europe/Paris". |
| 2 | |
| 3 | use android_system_properties::AndroidSystemProperties; |
| 4 | |
| 5 | fn main() { |
| 6 | let android_system_properties = AndroidSystemProperties::new(); |
| 7 | let tz = android_system_properties.get("persist.sys.timezone"); |
| 8 | println!("Your time zone is: {}", tz.as_deref().unwrap_or("<unknown>")); |
| 9 | } |