FormatStyleFlags Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Enumerates values returned by several methods of FormatStyleFlags and taken as a parameter of several methods of DateUtils.
This enumeration supports a bitwise combination of its member values.
[System.Flags]
public enum FormatStyleFlags
[<System.Flags>]
type FormatStyleFlags =
- Inheritance
-
FormatStyleFlags
- Attributes
Fields
| Name | Value | Description |
|---|---|---|
| ShowTime | 1 | Requests the time as part of the formatted date or range. |
| ShowWeekday | 2 | Requests the weekday name in the formatted output. |
| ShowYear | 4 | Requests the year when the date is shown, even if it is the current year. |
| NoYear | 8 | Requests omission of the year from a displayed date unless ShowYear is also set. |
| ShowDate | 16 | Requests the date, including for a range whose start and end are on the same day. |
| NoMonthDay | 32 | Requests a date without the day of the month, leaving the month and any requested year. |
| TwelveHour | 64 | Requests 12-hour time when time is shown. TwentyFourHour takes precedence if both flags are set. |
| TwentyFourHour | 128 | Requests 24-hour time when time is shown, overriding TwelveHour. |
| CapAmpm | 256 | Legacy flag that requests capitalized AM/PM markers in 12-hour output. ICU-based date-range formatting ignores this flag. |
| NoNoon | 512 | Legacy flag that requests a numeric 12-hour time instead of the word for noon. ICU-based date-range formatting ignores this flag. |
| CapNoon | 1024 | Legacy flag that requests capitalization of the word for noon in 12-hour output. ICU-based date-range formatting ignores this flag. |
| NoMidnight | 2048 | Legacy flag that requests a numeric 12-hour time instead of the word for midnight. ICU-based date-range formatting ignores this flag. |
| NoNoonMidnight | 2560 | Combines NoNoon and NoMidnight. ICU-based date-range formatting ignores these flags. |
| CapMidnight | 4096 | Legacy flag that requests capitalization of the word for midnight in 12-hour output. ICU-based date-range formatting ignores this flag. |
| CapNoonMidnight | 5120 | Combines CapNoon and CapMidnight. ICU-based date-range formatting ignores these flags. |
| Utc | 8192 | Requests UTC for date-range formatting. Prefer the overload that takes an explicit time zone. This constant was deprecated in API level 15. Use formatDateRange and pass in Time.TIMEZONE_UTC for the timeZone instead. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| AbbrevTime | 16384 | Requests omission of zero minutes from displayed 12-hour times. Minutes remain in 24-hour times. |
| AbbrevWeekday | 32768 | Requests an abbreviated weekday name when the weekday is shown. |
| AbbrevMonth | 65536 | Requests an abbreviated month name when the month is shown. |
| NumericDate | 131072 | Requests a numeric date instead of a date with a month name. Field order and separators depend on the locale. |
| AbbrevRelative | 262144 | Requests abbreviated relative-time text where the locale provides it. |
| AbbrevAll | 524288 | Requests abbreviated month, weekday, and time forms for date ranges, and abbreviated relative-time text where available. |
Remarks
These flags control the fields and styles requested from date and time formatting methods. The output depends on the locale and Android version. Legacy capitalization, noon, and midnight flags are not used by ICU-based date-range formatting.
See the Android DateUtils source and the ICU date-format flag mapping.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.