Fix build break
[chromium-blink-merge.git] / chrome / browser / google_apis / time_util.h
blobfc4d8db295bbadc12b368163f68ea12c4a644c40
1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_GOOGLE_APIS_TIME_UTIL_H_
6 #define CHROME_BROWSER_GOOGLE_APIS_TIME_UTIL_H_
8 #include <string>
10 #include "base/strings/string_piece.h"
12 namespace base {
13 class Time;
14 } // namespace base
16 namespace google_apis {
17 namespace util {
19 // Parses an RFC 3339 date/time into a base::Time, returning true on success.
20 // The time string must be in the format "yyyy-mm-ddThh:mm:ss.dddTZ" (TZ is
21 // either '+hh:mm', '-hh:mm', 'Z' (representing UTC), or an empty string).
22 bool GetTimeFromString(const base::StringPiece& raw_value, base::Time* time);
24 // Formats a base::Time as an RFC 3339 date/time (in UTC).
25 std::string FormatTimeAsString(const base::Time& time);
26 // Formats a base::Time as an RFC 3339 date/time (in localtime).
27 std::string FormatTimeAsStringLocaltime(const base::Time& time);
29 } // namespace util
30 } // namespace google_apis
32 #endif // CHROME_BROWSER_GOOGLE_APIS_TIME_UTIL_H_