| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Basic time formatting methods. These methods use the current locale | 5 // Basic time formatting methods. These methods use the current locale |
| 6 // formatting for displaying the time. | 6 // formatting for displaying the time. |
| 7 | 7 |
| 8 #ifndef BASE_I18N_TIME_FORMATTING_H_ | 8 #ifndef BASE_I18N_TIME_FORMATTING_H_ |
| 9 #define BASE_I18N_TIME_FORMATTING_H_ | 9 #define BASE_I18N_TIME_FORMATTING_H_ |
| 10 #pragma once | 10 #pragma once |
| 11 | 11 |
| 12 #include <string> | 12 #include "base/string16.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 | 15 |
| 16 class Time; | 16 class Time; |
| 17 | 17 |
| 18 // Returns the time of day, e.g., "3:07 PM". | 18 // Returns the time of day, e.g., "3:07 PM". |
| 19 std::wstring TimeFormatTimeOfDay(const Time& time); | 19 string16 TimeFormatTimeOfDay(const Time& time); |
| 20 | 20 |
| 21 // Returns a shortened date, e.g. "Nov 7, 2007" | 21 // Returns a shortened date, e.g. "Nov 7, 2007" |
| 22 std::wstring TimeFormatShortDate(const Time& time); | 22 string16 TimeFormatShortDate(const Time& time); |
| 23 | 23 |
| 24 // Returns a numeric date such as 12/13/52. | 24 // Returns a numeric date such as 12/13/52. |
| 25 std::wstring TimeFormatShortDateNumeric(const Time& time); | 25 string16 TimeFormatShortDateNumeric(const Time& time); |
| 26 | 26 |
| 27 // Formats a time in a friendly sentence format, e.g. | 27 // Formats a time in a friendly sentence format, e.g. |
| 28 // "Monday, March 6, 2008 2:44:30 PM". | 28 // "Monday, March 6, 2008 2:44:30 PM". |
| 29 std::wstring TimeFormatShortDateAndTime(const Time& time); | 29 string16 TimeFormatShortDateAndTime(const Time& time); |
| 30 | 30 |
| 31 // Formats a time in a friendly sentence format, e.g. | 31 // Formats a time in a friendly sentence format, e.g. |
| 32 // "Monday, March 6, 2008 2:44:30 PM". | 32 // "Monday, March 6, 2008 2:44:30 PM". |
| 33 std::wstring TimeFormatFriendlyDateAndTime(const Time& time); | 33 string16 TimeFormatFriendlyDateAndTime(const Time& time); |
| 34 | 34 |
| 35 // Formats a time in a friendly sentence format, e.g. | 35 // Formats a time in a friendly sentence format, e.g. |
| 36 // "Monday, March 6, 2008". | 36 // "Monday, March 6, 2008". |
| 37 std::wstring TimeFormatFriendlyDate(const Time& time); | 37 string16 TimeFormatFriendlyDate(const Time& time); |
| 38 | 38 |
| 39 } // namespace base | 39 } // namespace base |
| 40 | 40 |
| 41 #endif // BASE_I18N_TIME_FORMATTING_H_ | 41 #endif // BASE_I18N_TIME_FORMATTING_H_ |
| OLD | NEW |