summaryrefslogtreecommitdiff
path: root/vendor/android_system_properties/examples/time_zone.rs
blob: f3a6a3c7b7a98abbe68da9b9e81711cc95057b46 (plain)
1
2
3
4
5
6
7
8
9
/// Prints the current time zone, e.g. "Europe/Paris".

use android_system_properties::AndroidSystemProperties;

fn main() {
    let android_system_properties = AndroidSystemProperties::new();
    let tz = android_system_properties.get("persist.sys.timezone");
    println!("Your time zone is: {}", tz.as_deref().unwrap_or("<unknown>"));
}