Merge pull request #725 from kbravh/tz-variable-patch

Update determine_time_zone function to check TZ
This commit is contained in:
Benjamin Sago 2020-10-08 22:37:00 +01:00 committed by GitHub
commit 8b852cb201
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
use std::cmp::max;
use std::env;
use std::fmt;
use std::ops::Deref;
use std::sync::{Mutex, MutexGuard};
@ -291,8 +292,12 @@ impl Environment {
}
fn determine_time_zone() -> TZResult<TimeZone> {
if let Ok(file) = env::var("TZ") {
TimeZone::from_file(format!("/usr/share/zoneinfo/{}", file))
} else {
TimeZone::from_file("/etc/localtime")
}
}
pub struct Table<'a> {