Chromium Code Reviews| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 | 73 |
| 74 // Formats a time in a friendly sentence format, e.g. | 74 // Formats a time in a friendly sentence format, e.g. |
| 75 // "Monday, March 6, 2008". | 75 // "Monday, March 6, 2008". |
| 76 BASE_I18N_EXPORT string16 TimeFormatFriendlyDate(const Time& time); | 76 BASE_I18N_EXPORT string16 TimeFormatFriendlyDate(const Time& time); |
| 77 | 77 |
| 78 // Formats a time duration of hours and minutes into various formats, e.g., | 78 // 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. | 79 // "3:07" or "3 hours, 7 minutes". See DurationFormatWidth for details. |
| 80 BASE_I18N_EXPORT string16 TimeDurationFormat(const TimeDelta& time, | 80 BASE_I18N_EXPORT string16 TimeDurationFormat(const TimeDelta& time, |
| 81 const DurationFormatWidth width); | 81 const DurationFormatWidth width); |
| 82 | 82 |
| 83 // Formats a time duration of hours, minutes and seconds into various formats, | |
| 84 // e.g., "3:07:30" or "3 hours, 7 minutes, 30 seconds". See DurationFormatWidth | |
| 85 // for details. | |
| 86 BASE_I18N_EXPORT string16 | |
| 87 TimeDurationWFormatWithSecondPrecison(const TimeDelta& time, | |
|
brucedawson
2016/12/19 21:51:05
Why 'W'Format?
Also, consider FormatWithSeconds i
stanisc
2016/12/19 22:44:10
What about sub-second precision? Should we conside
chengx
2016/12/20 00:51:12
I vote for "WithSeconds", as the other one is "Wit
chengx
2016/12/20 00:51:12
Done.
| |
| 88 const DurationFormatWidth width); | |
| 89 | |
| 83 // Gets the hour clock type of the current locale. e.g. | 90 // Gets the hour clock type of the current locale. e.g. |
| 84 // k12HourClock (en-US). | 91 // k12HourClock (en-US). |
| 85 // k24HourClock (en-GB). | 92 // k24HourClock (en-GB). |
| 86 BASE_I18N_EXPORT HourClockType GetHourClockType(); | 93 BASE_I18N_EXPORT HourClockType GetHourClockType(); |
| 87 | 94 |
| 88 } // namespace base | 95 } // namespace base |
| 89 | 96 |
| 90 #endif // BASE_I18N_TIME_FORMATTING_H_ | 97 #endif // BASE_I18N_TIME_FORMATTING_H_ |
| OLD | NEW |