| OLD | NEW |
| 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 // 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 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 // Returns a shortened date, e.g. "Nov 7, 2007" | 56 // Returns a shortened date, e.g. "Nov 7, 2007" |
| 57 BASE_I18N_EXPORT string16 TimeFormatShortDate(const Time& time); | 57 BASE_I18N_EXPORT string16 TimeFormatShortDate(const Time& time); |
| 58 | 58 |
| 59 // Returns a numeric date such as 12/13/52. | 59 // Returns a numeric date such as 12/13/52. |
| 60 BASE_I18N_EXPORT string16 TimeFormatShortDateNumeric(const Time& time); | 60 BASE_I18N_EXPORT string16 TimeFormatShortDateNumeric(const Time& time); |
| 61 | 61 |
| 62 // Returns a numeric date and time such as "12/13/52 2:44:30 PM". | 62 // Returns a numeric date and time such as "12/13/52 2:44:30 PM". |
| 63 BASE_I18N_EXPORT string16 TimeFormatShortDateAndTime(const Time& time); | 63 BASE_I18N_EXPORT string16 TimeFormatShortDateAndTime(const Time& time); |
| 64 | 64 |
| 65 // Returns a month and year, e.g. "November 2007" |
| 66 BASE_I18N_EXPORT string16 TimeFormatMonthAndYear(const Time& time); |
| 67 |
| 68 // Returns a weekday, month and day, e.g. "Tuesday, 7 November" |
| 69 BASE_I18N_EXPORT string16 TimeFormatWeekdayMonthAndDay(const Time& time); |
| 70 |
| 65 // Returns a numeric date and time with time zone such as | 71 // Returns a numeric date and time with time zone such as |
| 66 // "12/13/52 2:44:30 PM PST". | 72 // "12/13/52 2:44:30 PM PST". |
| 67 BASE_I18N_EXPORT string16 | 73 BASE_I18N_EXPORT string16 |
| 68 TimeFormatShortDateAndTimeWithTimeZone(const Time& time); | 74 TimeFormatShortDateAndTimeWithTimeZone(const Time& time); |
| 69 | 75 |
| 70 // Formats a time in a friendly sentence format, e.g. | 76 // Formats a time in a friendly sentence format, e.g. |
| 71 // "Monday, March 6, 2008 2:44:30 PM". | 77 // "Monday, March 6, 2008 2:44:30 PM". |
| 72 BASE_I18N_EXPORT string16 TimeFormatFriendlyDateAndTime(const Time& time); | 78 BASE_I18N_EXPORT string16 TimeFormatFriendlyDateAndTime(const Time& time); |
| 73 | 79 |
| 74 // Formats a time in a friendly sentence format, e.g. | 80 // Formats a time in a friendly sentence format, e.g. |
| 75 // "Monday, March 6, 2008". | 81 // "Monday, March 6, 2008". |
| 76 BASE_I18N_EXPORT string16 TimeFormatFriendlyDate(const Time& time); | 82 BASE_I18N_EXPORT string16 TimeFormatFriendlyDate(const Time& time); |
| 77 | 83 |
| 78 // Formats a time duration of hours and minutes into various formats, e.g., | 84 // Formats a time duration of hours and minutes into various formats, e.g., |
| 79 // "3:07" or "3 hours, 7 minutes". See DurationFormatWidth for details. | 85 // "3:07" or "3 hours, 7 minutes". See DurationFormatWidth for details. |
| 80 BASE_I18N_EXPORT string16 TimeDurationFormat(const TimeDelta& time, | 86 BASE_I18N_EXPORT string16 TimeDurationFormat(const TimeDelta& time, |
| 81 const DurationFormatWidth width); | 87 const DurationFormatWidth width); |
| 82 | 88 |
| 83 // Gets the hour clock type of the current locale. e.g. | 89 // Gets the hour clock type of the current locale. e.g. |
| 84 // k12HourClock (en-US). | 90 // k12HourClock (en-US). |
| 85 // k24HourClock (en-GB). | 91 // k24HourClock (en-GB). |
| 86 BASE_I18N_EXPORT HourClockType GetHourClockType(); | 92 BASE_I18N_EXPORT HourClockType GetHourClockType(); |
| 87 | 93 |
| 88 } // namespace base | 94 } // namespace base |
| 89 | 95 |
| 90 #endif // BASE_I18N_TIME_FORMATTING_H_ | 96 #endif // BASE_I18N_TIME_FORMATTING_H_ |
| OLD | NEW |