Use the chrono crate to handle time zones by parsing timestamps into DateTime objects and converting them between Utc and Local or specific TimeZone instances.
use chrono::{DateTime, Utc, Local, TimeZone};
fn main() {
let utc_now: DateTime<Utc> = Utc::now();
let local_now: DateTime<Local> = Local::now();
let converted = utc_now.with_timezone(&Local);
println!("UTC: {}", utc_now);
println!("Local: {}", local_now);
println!("Converted: {}", converted);
}
Add chrono = "0.4" to your Cargo.toml dependencies.