Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1825)

Unified Diff: base/build_time.cc

Issue 1641413002: Makes GetBuildTime behave identically on all build types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to #96 Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/build_time.cc
diff --git a/base/build_time.cc b/base/build_time.cc
index b8b42966908fb47e696f01a2709bb9a90f2bd448..6f496f2efd2a9c482151911d8ecad02873935ce3 100644
--- a/base/build_time.cc
+++ b/base/build_time.cc
@@ -4,6 +4,9 @@
#include "base/build_time.h"
+// Imports the generated build date, i.e. BUILD_DATE.
+#include "base/generated_build_date.h"
+
#include "base/logging.h"
#include "base/time/time.h"
@@ -11,17 +14,9 @@ namespace base {
Time GetBuildTime() {
Time integral_build_time;
- // The format of __DATE__ and __TIME__ is specified by the ANSI C Standard,
- // section 6.8.8.
- //
- // __DATE__ is exactly "Mmm DD YYYY".
- // __TIME__ is exactly "hh:mm:ss".
-#if defined(DONT_EMBED_BUILD_METADATA) && !defined(OFFICIAL_BUILD)
- const char kDateTime[] = "Sep 02 2008 08:00:00 PST";
-#else
- const char kDateTime[] = __DATE__ " " __TIME__ " PST";
-#endif
- bool result = Time::FromString(kDateTime, &integral_build_time);
+ // BUILD_DATE is exactly "Mmm DD YYYY".
+ const char kDateTime[] = BUILD_DATE " 05:00:00";
+ bool result = Time::FromUTCString(kDateTime, &integral_build_time);
DCHECK(result);
return integral_build_time;
}
« no previous file with comments | « base/build_time.h ('k') | base/build_time_unittest.cc » ('j') | build/config/posix/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698