We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
TZDIR
1 parent c8343c7 commit 7bb8390Copy full SHA for 7bb8390
src/offset/local/unix.rs
@@ -182,6 +182,16 @@ impl CachedTzInfo {
182
const ZONE_INFO_DIRECTORIES: [&str; 4] =
183
["/usr/share/zoneinfo", "/share/zoneinfo", "/etc/zoneinfo", "/usr/share/lib/zoneinfo"];
184
185
+ // Use the value of the `TZDIR` environment variable if set.
186
+ if let Some(tz_dir) = env::var_os("TZDIR") {
187
+ if !tz_dir.is_empty() {
188
+ let path = PathBuf::from(tz_dir);
189
+ if path.exists() {
190
+ return Ok(path);
191
+ }
192
193
194
+
195
for dir in &ZONE_INFO_DIRECTORIES {
196
let path = PathBuf::from(dir);
197
if path.exists() {
0 commit comments