diff options
Diffstat (limited to 'base/i18n/time_formatting.h')
-rw-r--r-- | base/i18n/time_formatting.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/base/i18n/time_formatting.h b/base/i18n/time_formatting.h index e70ad3d..99d1911 100644 --- a/base/i18n/time_formatting.h +++ b/base/i18n/time_formatting.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -15,9 +15,21 @@ namespace base { class Time; +// Argument type used to specify the hour clock type. +enum HourClockType { + k12HourClock, // Uses 1-12. e.g., "3:07 PM" + k24HourClock, // Uses 0-23. e.g., "15:07" +}; + // Returns the time of day, e.g., "3:07 PM". string16 TimeFormatTimeOfDay(const Time& time); +// Returns the time of day in the specified hour clock type. e.g. +// "3:07 PM" (type == k12HourClock). +// "15:07" (type == k24HourClock). +string16 TimeFormatTimeOfDayWithHourClockType(const Time& time, + HourClockType type); + // Returns a shortened date, e.g. "Nov 7, 2007" string16 TimeFormatShortDate(const Time& time); @@ -36,6 +48,11 @@ string16 TimeFormatFriendlyDateAndTime(const Time& time); // "Monday, March 6, 2008". string16 TimeFormatFriendlyDate(const Time& time); +// Gets the hour clock type of the current locale. e.g. +// k12HourClock (en-US). +// k24HourClock (en-GB). +HourClockType GetHourClockType(); + } // namespace base #endif // BASE_I18N_TIME_FORMATTING_H_ |