[email protected] | 08aa0276 | 2011-11-11 16:09:31 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #include "base/build_time.h" | ||||
6 | |||||
zforman | 08d91b7 | 2016-02-12 06:23:42 | [diff] [blame] | 7 | // Imports the generated build date, i.e. BUILD_DATE. |
8 | #include "base/generated_build_date.h" | ||||
9 | |||||
[email protected] | 08aa0276 | 2011-11-11 16:09:31 | [diff] [blame] | 10 | #include "base/logging.h" |
[email protected] | 99084f6 | 2013-06-28 00:49:07 | [diff] [blame] | 11 | #include "base/time/time.h" |
[email protected] | 08aa0276 | 2011-11-11 16:09:31 | [diff] [blame] | 12 | |
13 | namespace base { | ||||
14 | |||||
15 | Time GetBuildTime() { | ||||
16 | Time integral_build_time; | ||||
maruel | 1c9b0223 | 2016-04-04 20:21:41 | [diff] [blame] | 17 | // BUILD_DATE is exactly "Mmm DD YYYY HH:MM:SS". |
18 | // See //build/write_build_date_header.py. "HH:MM:SS" is normally expected to | ||||
19 | // be "05:00:00" but is not enforced here. | ||||
20 | bool result = Time::FromUTCString(BUILD_DATE, &integral_build_time); | ||||
[email protected] | 08aa0276 | 2011-11-11 16:09:31 | [diff] [blame] | 21 | DCHECK(result); |
22 | return integral_build_time; | ||||
23 | } | ||||
24 | |||||
25 | } // namespace base |