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

Side by Side Diff: base/build_time.cc

Issue 1846713002: Improve the error message in BuildTime.InThePast to help figure out the problem. (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Improved comment Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « base/BUILD.gn ('k') | base/build_time_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/build_time.h" 5 #include "base/build_time.h"
6 6
7 // Imports the generated build date, i.e. BUILD_DATE. 7 // Imports the generated build date, i.e. BUILD_DATE.
8 #include "base/generated_build_date.h" 8 #include "base/generated_build_date.h"
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 12
13 namespace base { 13 namespace base {
14 14
15 Time GetBuildTime() { 15 Time GetBuildTime() {
16 Time integral_build_time; 16 Time integral_build_time;
17 // BUILD_DATE is exactly "Mmm DD YYYY". 17 // BUILD_DATE is exactly "Mmm DD YYYY HH:MM:SS".
18 const char kDateTime[] = BUILD_DATE " 05:00:00"; 18 // See //build/write_build_date_header.py. "HH:MM:SS" is normally expected to
19 bool result = Time::FromUTCString(kDateTime, &integral_build_time); 19 // be "05:00:00" but is not enforced here.
20 bool result = Time::FromUTCString(BUILD_DATE, &integral_build_time);
20 DCHECK(result); 21 DCHECK(result);
21 return integral_build_time; 22 return integral_build_time;
22 } 23 }
23 24
24 } // namespace base 25 } // namespace base
OLDNEW
« no previous file with comments | « base/BUILD.gn ('k') | base/build_time_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698