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 12 matching lines...) Expand all Loading... |
23 | 23 |
24 // Argument type used to specify whether or not to include AM/PM sign. | 24 // Argument type used to specify whether or not to include AM/PM sign. |
25 enum AmPmClockType { | 25 enum AmPmClockType { |
26 kDropAmPm, // Drops AM/PM sign. e.g., "3:07" | 26 kDropAmPm, // Drops AM/PM sign. e.g., "3:07" |
27 kKeepAmPm, // Keeps AM/PM sign. e.g., "3:07 PM" | 27 kKeepAmPm, // Keeps AM/PM sign. e.g., "3:07 PM" |
28 }; | 28 }; |
29 | 29 |
30 // Returns the time of day, e.g., "3:07 PM". | 30 // Returns the time of day, e.g., "3:07 PM". |
31 BASE_I18N_EXPORT string16 TimeFormatTimeOfDay(const Time& time); | 31 BASE_I18N_EXPORT string16 TimeFormatTimeOfDay(const Time& time); |
32 | 32 |
| 33 // Returns the time of day in 24-hour clock format with millisecond accuracy, |
| 34 // e.g., "15:07:30.568" |
| 35 BASE_I18N_EXPORT string16 TimeFormatTimeOfDayWithMilliseconds(const Time& time); |
| 36 |
33 // Returns the time of day in the specified hour clock type. e.g. | 37 // Returns the time of day in the specified hour clock type. e.g. |
34 // "3:07 PM" (type == k12HourClock, ampm == kKeepAmPm). | 38 // "3:07 PM" (type == k12HourClock, ampm == kKeepAmPm). |
35 // "3:07" (type == k12HourClock, ampm == kDropAmPm). | 39 // "3:07" (type == k12HourClock, ampm == kDropAmPm). |
36 // "15:07" (type == k24HourClock). | 40 // "15:07" (type == k24HourClock). |
37 BASE_I18N_EXPORT string16 TimeFormatTimeOfDayWithHourClockType( | 41 BASE_I18N_EXPORT string16 TimeFormatTimeOfDayWithHourClockType( |
38 const Time& time, | 42 const Time& time, |
39 HourClockType type, | 43 HourClockType type, |
40 AmPmClockType ampm); | 44 AmPmClockType ampm); |
41 | 45 |
42 // Returns a shortened date, e.g. "Nov 7, 2007" | 46 // Returns a shortened date, e.g. "Nov 7, 2007" |
(...skipping 19 matching lines...) Expand all Loading... |
62 BASE_I18N_EXPORT string16 TimeFormatFriendlyDate(const Time& time); | 66 BASE_I18N_EXPORT string16 TimeFormatFriendlyDate(const Time& time); |
63 | 67 |
64 // Gets the hour clock type of the current locale. e.g. | 68 // Gets the hour clock type of the current locale. e.g. |
65 // k12HourClock (en-US). | 69 // k12HourClock (en-US). |
66 // k24HourClock (en-GB). | 70 // k24HourClock (en-GB). |
67 BASE_I18N_EXPORT HourClockType GetHourClockType(); | 71 BASE_I18N_EXPORT HourClockType GetHourClockType(); |
68 | 72 |
69 } // namespace base | 73 } // namespace base |
70 | 74 |
71 #endif // BASE_I18N_TIME_FORMATTING_H_ | 75 #endif // BASE_I18N_TIME_FORMATTING_H_ |
OLD | NEW |