From 0a502d0f383a91ea7926c3f210d75914fbcd2462 Mon Sep 17 00:00:00 2001 From: "Hatter Jiang@Pixelbook" Date: Fri, 9 Aug 2019 00:28:29 +0800 Subject: [PATCH] build date --- build.rs | 2 +- src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index 7ffdd60..11104b3 100644 --- a/build.rs +++ b/build.rs @@ -3,7 +3,7 @@ fn main() { let output = Command::new("git").args(&["rev-parse", "HEAD"]).output().unwrap(); let git_hash = String::from_utf8(output.stdout).unwrap(); println!("cargo:rustc-env=GIT_HASH={}", git_hash); - let date_output = Command::new("date").output().unwrap(); + let date_output = Command::new("date").args(&["+%Y-%m-%dT%H:%M:%S%z"]).output().unwrap(); let date = String::from_utf8(date_output.stdout).unwrap(); println!("cargo:rustc-env=BUILD_DATE={}", date); } diff --git a/src/main.rs b/src/main.rs index 76810af..7d57134 100644 --- a/src/main.rs +++ b/src/main.rs @@ -142,7 +142,7 @@ fn main() { if *VERBOSE { print_message(MessageType::DEBUG, &format!("Full GIT_HASH: {}", GIT_HASH)); - print_message(MessageType::DEBUG, &format!("Binary build date: {}", BUILD_DATE)); + print_message(MessageType::DEBUG, &format!("Build date: {}", BUILD_DATE)); } let args = local_util::get_args_as_vec();