diff --git a/tui/build.rs b/tui/build.rs index 121931c1..bcaf5e2e 100644 --- a/tui/build.rs +++ b/tui/build.rs @@ -1,7 +1,14 @@ +use chrono::{TimeZone, Utc}; +use std::env; + fn main() { // Add current date as a variable to be displayed in the 'Linux Toolbox' text. + let now = match env::var("SOURCE_DATE_EPOCH") { + Ok(val) => { Utc.timestamp_opt(val.parse::().unwrap(), 0).unwrap() } + Err(_) => Utc::now(), + }; println!( "cargo:rustc-env=BUILD_DATE={}", - chrono::Local::now().format("%Y-%m-%d") + now.format("%Y-%m-%d") ); }