From cda02dc7e9e512068dad913b7dc841581a6c907a Mon Sep 17 00:00:00 2001
From: chengtbf <472491134@qq.com>
Date: Tue, 5 Jun 2018 13:17:02 +0800
Subject: [PATCH] fix date time display of --version (#918)

---
 oneflow/core/job/oneflow.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/oneflow/core/job/oneflow.cpp b/oneflow/core/job/oneflow.cpp
index f108aa53b..6da27ec72 100644
--- a/oneflow/core/job/oneflow.cpp
+++ b/oneflow/core/job/oneflow.cpp
@@ -27,8 +27,10 @@ std::string BuildVersionString() {
       {"Jul", "07"}, {"Aug", "08"}, {"Sep", "09"}, {"Oct", "10"}, {"Nov", "11"}, {"Dec", "12"},
   };
   static const std::string date_str(__DATE__);
-  return OF_VERSION " (" + date_str.substr(7) + month_word2num.at(date_str.substr(0, 3))
-         + date_str.substr(4, 2) + "." + __TIME__ + ")";
+  std::string day = date_str.substr(4, 2);
+  StringReplace(&day, ' ', '0');
+  return OF_VERSION " (" + date_str.substr(7) + month_word2num.at(date_str.substr(0, 3)) + day + "."
+         + __TIME__ + ")";
 }
 
 std::string GetAmdCtrlKey(int64_t machine_id) {
-- 
GitLab