Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/icu/text/DateFormatSymbols#constants) \| [Ctors](https://developer.android.com/reference/android/icu/text/DateFormatSymbols#pubctors) \| [Methods](https://developer.android.com/reference/android/icu/text/DateFormatSymbols#pubmethods) \| [Protected Methods](https://developer.android.com/reference/android/icu/text/DateFormatSymbols#promethods) \| [Inherited Methods](https://developer.android.com/reference/android/icu/text/DateFormatSymbols#inhmethods)

# DateFormatSymbols

*** ** * ** ***

` public class DateFormatSymbols `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/java/lang/Cloneable, https://developer.android.com/reference/java/io/Serializable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.icu.text.DateFormatSymbols |

<br />

*** ** * ** ***

**\[icu enhancement\]** ICU's replacement for `https://developer.android.com/reference/java/text/DateFormatSymbols`. Methods, fields, and other functionality specific to ICU are labeled '**\[icu\]**'.

`DateFormatSymbols` is a public class for encapsulating localizable date-time formatting data, such as the names of the months, the names of the days of the week, and the time zone data. `DateFormat` and `SimpleDateFormat` both use `DateFormatSymbols` to encapsulate this information.

Typically you shouldn't use `DateFormatSymbols` directly. Rather, you are encouraged to create a date-time formatter with the `DateFormat` class's factory methods: `getTimeInstance`, `getDateInstance`, or `getDateTimeInstance`. These methods automatically create a `DateFormatSymbols` for the formatter so that you don't have to. After the formatter is created, you may modify its format pattern using the `setPattern` method. For more information about creating formatters using `DateFormat`'s factory methods, see `https://developer.android.com/reference/android/icu/text/DateFormat`.

If you decide to create a date-time formatter with a specific format pattern for a specific locale, you can do so with:
>
> ```
> new SimpleDateFormat(aPattern, new DateFormatSymbols(aLocale)).
> ```

`DateFormatSymbols` objects are clonable. When you obtain a `DateFormatSymbols` object, feel free to modify the date-time formatting data. For instance, you can replace the localized date-time format pattern characters with the ones that you feel easy to remember. Or you can change the representative cities to your favorite ones.

New `DateFormatSymbols` subclasses may be added to support `SimpleDateFormat` for date-time formatting for additional locales.
**See also:**

- `https://developer.android.com/reference/android/icu/text/DateFormat`
- `https://developer.android.com/reference/android/icu/text/SimpleDateFormat`

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/icu/text/DateFormatSymbols#ABBREVIATED` **\[icu\]** Constant for width. |
| `int` | `https://developer.android.com/reference/android/icu/text/DateFormatSymbols#FORMAT` **\[icu\]** Constant for context. |
| `int` | `https://developer.android.com/reference/android/icu/text/DateFormatSymbols#NARROW` **\[icu\]** Constant for width. |
| `int` | `https://developer.android.com/reference/android/icu/text/DateFormatSymbols#SHORT` **\[icu\]** Constant for width; only supported for weekdays. |
| `int` | `https://developer.android.com/reference/android/icu/text/DateFormatSymbols#STANDALONE` **\[icu\]** Constant for context. |
| `int` | `https://developer.android.com/reference/android/icu/text/DateFormatSymbols#WIDE` **\[icu\]** Constant for width. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols()() ` Constructs a DateFormatSymbols object by loading format data from resources for the default `FORMAT` locale. |
| ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols(android.icu.util.Calendar,%20android.icu.util.ULocale)(https://developer.android.com/reference/android/icu/util/Calendar cal, https://developer.android.com/reference/android/icu/util/ULocale locale) ` Returns the `https://developer.android.com/reference/android/icu/text/DateFormatSymbols` object that should be used to format a calendar system's dates in the given locale. |
| ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols(android.icu.util.Calendar,%20java.util.Locale)(https://developer.android.com/reference/android/icu/util/Calendar cal, https://developer.android.com/reference/java/util/Locale locale) ` Returns the `https://developer.android.com/reference/android/icu/text/DateFormatSymbols` object that should be used to format a calendar system's dates in the given locale. |
| ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols(android.icu.util.ULocale)(https://developer.android.com/reference/android/icu/util/ULocale locale) ` **\[icu\]** Constructs a DateFormatSymbols object by loading format data from resources for the given ulocale. |
| ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols(java.lang.Class<?%20extends%20android.icu.util.Calendar>,%20android.icu.util.ULocale)(https://developer.android.com/reference/java/lang/Class<? extends https://developer.android.com/reference/android/icu/util/Calendar> calendarClass, https://developer.android.com/reference/android/icu/util/ULocale locale) ` Variant of DateFormatSymbols(Calendar, ULocale) that takes the Calendar class instead of a Calendar instance. |
| ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols(java.lang.Class<?%20extends%20android.icu.util.Calendar>,%20java.util.Locale)(https://developer.android.com/reference/java/lang/Class<? extends https://developer.android.com/reference/android/icu/util/Calendar> calendarClass, https://developer.android.com/reference/java/util/Locale locale) ` Variant of DateFormatSymbols(Calendar, Locale) that takes the Calendar class instead of a Calendar instance. |
| ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols(java.util.Locale)(https://developer.android.com/reference/java/util/Locale locale) ` Constructs a DateFormatSymbols object by loading format data from resources for the given locale. |
| ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols(java.util.ResourceBundle,%20android.icu.util.ULocale)(https://developer.android.com/reference/java/util/ResourceBundle bundle, https://developer.android.com/reference/android/icu/util/ULocale locale) ` Fetches a custom calendar's DateFormatSymbols out of the given resource bundle. |
| ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols(java.util.ResourceBundle,%20java.util.Locale)(https://developer.android.com/reference/java/util/ResourceBundle bundle, https://developer.android.com/reference/java/util/Locale locale) ` Fetches a custom calendar's DateFormatSymbols out of the given resource bundle. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#clone()() ` Overrides clone. |
| ` boolean` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Overrides equals. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getAmPmStrings()() ` Returns am/pm strings. |
| ` static https://developer.android.com/reference/java/util/Locale` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getAvailableLocales()() ` Returns an array of all locales for which the `getInstance` methods of this class can return localized instances. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getEraNames()() ` **\[icu\]** Returns full era name strings. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getEras()() ` Returns abbreviated era strings. |
| ` static https://developer.android.com/reference/android/icu/text/DateFormatSymbols` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getInstance()() ` Returns a DateFormatSymbols instance for the default locale. |
| ` static https://developer.android.com/reference/android/icu/text/DateFormatSymbols` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getInstance(java.util.Locale)(https://developer.android.com/reference/java/util/Locale locale) ` Returns a DateFormatSymbols instance for the given locale. |
| ` static https://developer.android.com/reference/android/icu/text/DateFormatSymbols` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getInstance(android.icu.util.ULocale)(https://developer.android.com/reference/android/icu/util/ULocale locale) ` **\[icu\]** Returns a DateFormatSymbols instance for the given locale. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getLocalPatternChars()() ` Returns localized date-time pattern characters. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getMonths(int,%20int)(int context, int width) ` Returns month strings. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getMonths()() ` Returns month strings. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getNarrowEras()() ` **\[icu\]** Returns narrow era name strings. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getQuarters(int,%20int)(int context, int width) ` **\[icu\]** Returns quarter strings. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getShortMonths()() ` Returns short month strings. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getShortWeekdays()() ` Returns abbreviated weekday strings; for example: "Sun", "Mon", etc. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getWeekdays(int,%20int)(int context, int width) ` Returns weekday strings. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getWeekdays()() ` Returns wide weekday strings. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getYearNames(int,%20int)(int context, int width) ` Returns cyclic year name strings if the calendar has them, for example: "jia-zi", "yi-chou", etc. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getZodiacNames(int,%20int)(int context, int width) ` Returns calendar zodiac name strings if the calendar has them, for example: "Rat", "Ox", "Tiger", etc. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#getZoneStrings()() ` Returns time zone strings. |
| ` int` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#hashCode()() ` Override hashCode. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setAmPmStrings(java.lang.String[])(https://developer.android.com/reference/java/lang/String newAmpms) ` Sets am/pm strings. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setEraNames(java.lang.String[])(https://developer.android.com/reference/java/lang/String newEraNames) ` **\[icu\]** Sets full era name strings. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setEras(java.lang.String[])(https://developer.android.com/reference/java/lang/String newEras) ` Sets abbreviated era strings. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setLocalPatternChars(java.lang.String)(https://developer.android.com/reference/java/lang/String newLocalPatternChars) ` Sets localized date-time pattern characters. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setMonths(java.lang.String[])(https://developer.android.com/reference/java/lang/String newMonths) ` Sets month strings. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setMonths(java.lang.String[],%20int,%20int)(https://developer.android.com/reference/java/lang/String newMonths, int context, int width) ` Sets month strings. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setNarrowEras(java.lang.String[])(https://developer.android.com/reference/java/lang/String newNarrowEras) ` **\[icu\]** Sets narrow era name strings. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setQuarters(java.lang.String[],%20int,%20int)(https://developer.android.com/reference/java/lang/String newQuarters, int context, int width) ` **\[icu\]** Sets quarter strings. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setShortMonths(java.lang.String[])(https://developer.android.com/reference/java/lang/String newShortMonths) ` Sets short month strings. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setShortWeekdays(java.lang.String[])(https://developer.android.com/reference/java/lang/String newAbbrevWeekdays) ` Sets abbreviated weekday strings; for example: "Sun", "Mon", etc. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setWeekdays(java.lang.String[])(https://developer.android.com/reference/java/lang/String newWeekdays) ` Sets wide weekday strings. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setWeekdays(java.lang.String[],%20int,%20int)(https://developer.android.com/reference/java/lang/String newWeekdays, int context, int width) ` Sets weekday strings. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setYearNames(java.lang.String[],%20int,%20int)(https://developer.android.com/reference/java/lang/String yearNames, int context, int width) ` Sets cyclic year name strings, for example: "jia-zi", "yi-chou", etc. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setZodiacNames(java.lang.String[],%20int,%20int)(https://developer.android.com/reference/java/lang/String zodiacNames, int context, int width) ` Sets calendar zodiac name strings, for example: "Rat", "Ox", "Tiger", etc. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#setZoneStrings(java.lang.String[][])(https://developer.android.com/reference/java/lang/String newZoneStrings) ` Sets time zone strings. |

| ### Protected methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/icu/text/DateFormatSymbols#initializeData(android.icu.util.ULocale,%20java.lang.String)(https://developer.android.com/reference/android/icu/util/ULocale desiredLocale, https://developer.android.com/reference/java/lang/String type) ` Initializes format symbols for the locale and calendar type |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### ABBREVIATED

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ABBREVIATED
```

**\[icu\]** Constant for width.

<br />

Constant Value: 0 (0x00000000)

### FORMAT

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FORMAT
```

**\[icu\]** Constant for context.

<br />

Constant Value: 0 (0x00000000)

### NARROW

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int NARROW
```

**\[icu\]** Constant for width.

<br />

Constant Value: 2 (0x00000002)

### SHORT

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SHORT
```

**\[icu\]** Constant for width; only supported for weekdays.

<br />

Constant Value: 3 (0x00000003)

### STANDALONE

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STANDALONE
```

**\[icu\]** Constant for context.

<br />

Constant Value: 1 (0x00000001)

### WIDE

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIDE
```

**\[icu\]** Constant for width.

<br />

Constant Value: 1 (0x00000001)

## Public constructors

### DateFormatSymbols

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DateFormatSymbols ()
```

Constructs a DateFormatSymbols object by loading format data from resources for the default `FORMAT` locale.

<br />

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/util/MissingResourceException` | if the resources for the default locale cannot be found or cannot be loaded. |

**See also:**

- `https://developer.android.com/reference/android/icu/util/ULocale.Category#FORMAT`

### DateFormatSymbols

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DateFormatSymbols (Calendar cal, 
                ULocale locale)
```

Returns the `https://developer.android.com/reference/android/icu/text/DateFormatSymbols` object that should be used to format a calendar system's dates in the given locale.

<br />

| Parameters ||
|---|---|
| `cal` | `Calendar`: The calendar system whose date format symbols are desired. <br /> |
| `locale` | `ULocale`: The ulocale whose symbols are desired. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols(java.util.Locale)`

### DateFormatSymbols

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DateFormatSymbols (Calendar cal, 
                Locale locale)
```

Returns the `https://developer.android.com/reference/android/icu/text/DateFormatSymbols` object that should be used to format a calendar system's dates in the given locale.

<br />

| Parameters ||
|---|---|
| `cal` | `Calendar`: The calendar system whose date format symbols are desired. <br /> |
| `locale` | `Locale`: The locale whose symbols are desired. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols(java.util.Locale)`

### DateFormatSymbols

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DateFormatSymbols (ULocale locale)
```

**\[icu\]** Constructs a DateFormatSymbols object by loading format data from resources for the given ulocale.

<br />

| Parameters ||
|---|---|
| `locale` | `ULocale` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/util/MissingResourceException` | if the resources for the specified locale cannot be found or cannot be loaded. |

### DateFormatSymbols

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DateFormatSymbols (Class<? extends Calendar> calendarClass, 
                ULocale locale)
```

Variant of DateFormatSymbols(Calendar, ULocale) that takes the Calendar class instead of a Calendar instance.

<br />

| Parameters ||
|---|---|
| `calendarClass` | `Class` <br /> |
| `locale` | `ULocale` <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols(android.icu.util.Calendar,%20java.util.Locale)`

### DateFormatSymbols

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DateFormatSymbols (Class<? extends Calendar> calendarClass, 
                Locale locale)
```

Variant of DateFormatSymbols(Calendar, Locale) that takes the Calendar class instead of a Calendar instance.

<br />

| Parameters ||
|---|---|
| `calendarClass` | `Class` <br /> |
| `locale` | `Locale` <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols(android.icu.util.Calendar,%20java.util.Locale)`

### DateFormatSymbols

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DateFormatSymbols (Locale locale)
```

Constructs a DateFormatSymbols object by loading format data from resources for the given locale.

<br />

| Parameters ||
|---|---|
| `locale` | `Locale` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/util/MissingResourceException` | if the resources for the specified locale cannot be found or cannot be loaded. |

### DateFormatSymbols

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DateFormatSymbols (ResourceBundle bundle, 
                ULocale locale)
```

Fetches a custom calendar's DateFormatSymbols out of the given resource bundle. Symbols that are not overridden are inherited from the default DateFormatSymbols for the locale.

<br />

| Parameters ||
|---|---|
| `bundle` | `ResourceBundle` <br /> |
| `locale` | `ULocale` <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols(java.util.Locale)`

### DateFormatSymbols

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DateFormatSymbols (ResourceBundle bundle, 
                Locale locale)
```

Fetches a custom calendar's DateFormatSymbols out of the given resource bundle. Symbols that are not overridden are inherited from the default DateFormatSymbols for the locale.

<br />

| Parameters ||
|---|---|
| `bundle` | `ResourceBundle` <br /> |
| `locale` | `Locale` <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/DateFormatSymbols#DateFormatSymbols(java.util.Locale)`

## Public methods

### clone

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Object clone ()
```

Overrides clone.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/Object` | a clone of this instance. <br /> |

### equals

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean equals (Object obj)
```

Overrides equals.

<br />

| Parameters ||
|---|---|
| `obj` | `Object`: the reference object with which to compare. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this object is the same as the obj argument; `false` otherwise. <br /> |

### getAmPmStrings

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getAmPmStrings ()
```

Returns am/pm strings. For example: "AM" and "PM".

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the weekday strings. <br /> |

### getAvailableLocales

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Locale[] getAvailableLocales ()
```

Returns an array of all locales for which the `getInstance` methods of this class can return localized instances. **\[icu\] Note:** Unlike `java.text.DateFormatSymbols#getAvailableLocales`, this method simply returns the array of `Locale`s available in this class. ICU does not support `DateFormatSymbolsProvider` introduced in Java 6 or its equivalent implementation for now.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Locale` | An array of `Locale`s for which localized `DateFormatSymbols` instances are available. <br /> |

### getEraNames

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getEraNames ()
```

**\[icu\]** Returns full era name strings. For example: "Anno Domini" and "Before Christ".

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the era strings. <br /> |

### getEras

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getEras ()
```

Returns abbreviated era strings. For example: "AD" and "BC".

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the era strings. <br /> |

### getInstance

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static DateFormatSymbols getInstance ()
```

Returns a DateFormatSymbols instance for the default locale. **\[icu\] Note:** Unlike `java.text.DateFormatSymbols#getInstance`, this method simply returns `new android.icu.text.DateFormatSymbols()`. ICU does not support `DateFormatSymbolsProvider` introduced in Java 6 or its equivalent implementation for now.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/DateFormatSymbols` | A DateFormatSymbols instance. <br /> |

### getInstance

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static DateFormatSymbols getInstance (Locale locale)
```

Returns a DateFormatSymbols instance for the given locale. **\[icu\] Note:** Unlike `java.text.DateFormatSymbols#getInstance`, this method simply returns `new android.icu.text.DateFormatSymbols(locale)`. ICU does not support `DateFormatSymbolsProvider` introduced in Java 6 or its equivalent implementation for now.

<br />

| Parameters ||
|---|---|
| `locale` | `Locale`: the locale. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/DateFormatSymbols` | A DateFormatSymbols instance. <br /> |

### getInstance

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static DateFormatSymbols getInstance (ULocale locale)
```

**\[icu\]** Returns a DateFormatSymbols instance for the given locale. **\[icu\] Note:** Unlike `java.text.DateFormatSymbols#getInstance`, this method simply returns `new android.icu.text.DateFormatSymbols(locale)`. ICU does not support `DateFormatSymbolsProvider` introduced in Java 6 or its equivalent implementation for now.

<br />

| Parameters ||
|---|---|
| `locale` | `ULocale`: the locale. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/DateFormatSymbols` | A DateFormatSymbols instance. <br /> |

### getLocalPatternChars

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getLocalPatternChars ()
```

Returns localized date-time pattern characters. For example: 'u', 't', etc.

Note: ICU no longer provides localized date-time pattern characters for a locale starting ICU 3.8. This method returns the non-localized date-time pattern characters unless user defined localized data is set by setLocalPatternChars.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the localized date-time pattern characters. <br /> |

### getMonths

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getMonths (int context, 
                int width)
```

Returns month strings. For example: "January", "February", etc.

<br />

| Parameters ||
|---|---|
| `context` | `int`: The month context, FORMAT or STANDALONE. <br /> |
| `width` | `int`: The width or the returned month string, either WIDE, ABBREVIATED, or NARROW. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the month strings. <br /> |

### getMonths

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getMonths ()
```

Returns month strings. For example: "January", "February", etc.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the month strings. <br /> |

### getNarrowEras

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getNarrowEras ()
```

**\[icu\]** Returns narrow era name strings. For example: "A" and "B".

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the narrow era strings. <br /> |

### getQuarters

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getQuarters (int context, 
                int width)
```

**\[icu\]** Returns quarter strings. For example: "1st Quarter", "2nd Quarter", etc.

<br />

| Parameters ||
|---|---|
| `context` | `int`: The quarter context, FORMAT or STANDALONE. <br /> |
| `width` | `int`: The width or the returned quarter string, WIDE, NARROW, or ABBREVIATED. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the quarter strings. <br /> |

### getShortMonths

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getShortMonths ()
```

Returns short month strings. For example: "Jan", "Feb", etc.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the short month strings. <br /> |

### getShortWeekdays

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getShortWeekdays ()
```

Returns abbreviated weekday strings; for example: "Sun", "Mon", etc. (Note: the method name is misleading; it does not get the CLDR-style "short" weekday strings, e.g. "Su", "Mo", etc.)

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the abbreviated weekday strings. Use `Calendar.SUNDAY`, `Calendar.MONDAY`, etc. to index the result array. <br /> |

### getWeekdays

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getWeekdays (int context, 
                int width)
```

Returns weekday strings. For example: "Sunday", "Monday", etc.

<br />

| Parameters ||
|---|---|
| `context` | `int`: Formatting context, either FORMAT or STANDALONE. <br /> |
| `width` | `int`: Width of strings to be returned, either WIDE, ABBREVIATED, SHORT, or NARROW <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the weekday strings. Use `Calendar.SUNDAY`, `Calendar.MONDAY`, etc. to index the result array. <br /> |

### getWeekdays

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getWeekdays ()
```

Returns wide weekday strings. For example: "Sunday", "Monday", etc.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the weekday strings. Use `Calendar.SUNDAY`, `Calendar.MONDAY`, etc. to index the result array. <br /> |

### getYearNames

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getYearNames (int context, 
                int width)
```

Returns cyclic year name strings if the calendar has them, for example: "jia-zi", "yi-chou", etc.

<br />

| Parameters ||
|---|---|
| `context` | `int`: The usage context: FORMAT, STANDALONE. <br /> |
| `width` | `int`: The requested name width: WIDE, ABBREVIATED, SHORT, NARROW. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The year name strings, or null if they are not available for this calendar. <br /> |

### getZodiacNames

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getZodiacNames (int context, 
                int width)
```

Returns calendar zodiac name strings if the calendar has them, for example: "Rat", "Ox", "Tiger", etc.

<br />

| Parameters ||
|---|---|
| `context` | `int`: The usage context: FORMAT, STANDALONE. <br /> |
| `width` | `int`: The requested name width: WIDE, ABBREVIATED, SHORT, NARROW. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The zodiac name strings, or null if they are not available for this calendar. <br /> |

### getZoneStrings

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[][] getZoneStrings ()
```

Returns time zone strings.

The array returned by this API is a two dimensional String array and each row contains at least following strings:

- ZoneStrings\[n\]\[0\] - System time zone ID
- ZoneStrings\[n\]\[1\] - Long standard time display name
- ZoneStrings\[n\]\[2\] - Short standard time display name
- ZoneStrings\[n\]\[3\] - Long daylight saving time display name
- ZoneStrings\[n\]\[4\] - Short daylight saving time display name

When a localized display name is not available, the corresponding array element will be `null`.

**Note** : ICU implements the time zone display name formatting algorithm specified by [UTS#35 Unicode Locale Data Markup Language(LDML)](http://www.unicode.org/reports/tr35/). The algorithm supports historic display name changes and various different types of names not available in `https://developer.android.com/reference/java/text/DateFormatSymbols#getZoneStrings()`. For accessing the full set of time zone string data used by ICU implementation, you should use `https://developer.android.com/reference/android/icu/text/TimeZoneNames` APIs instead.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the time zone strings. <br /> |

### hashCode

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int hashCode ()
```

Override hashCode. Generates a hash code for the DateFormatSymbols object.

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### setAmPmStrings

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setAmPmStrings (String[] newAmpms)
```

Sets am/pm strings. For example: "AM" and "PM".

<br />

| Parameters ||
|---|---|
| `newAmpms` | `String`: the new ampm strings. <br /> |

### setEraNames

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setEraNames (String[] newEraNames)
```

**\[icu\]** Sets full era name strings. For example: "Anno Domini" and "Before Christ".

<br />

| Parameters ||
|---|---|
| `newEraNames` | `String`: the new era strings. <br /> |

### setEras

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setEras (String[] newEras)
```

Sets abbreviated era strings. For example: "AD" and "BC".

<br />

| Parameters ||
|---|---|
| `newEras` | `String`: the new era strings. <br /> |

### setLocalPatternChars

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setLocalPatternChars (String newLocalPatternChars)
```

Sets localized date-time pattern characters. For example: 'u', 't', etc.

<br />

| Parameters ||
|---|---|
| `newLocalPatternChars` | `String`: the new localized date-time pattern characters. <br /> |

### setMonths

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setMonths (String[] newMonths)
```

Sets month strings. For example: "January", "February", etc.

<br />

| Parameters ||
|---|---|
| `newMonths` | `String`: the new month strings. <br /> |

### setMonths

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setMonths (String[] newMonths, 
                int context, 
                int width)
```

Sets month strings. For example: "January", "February", etc.

<br />

| Parameters ||
|---|---|
| `newMonths` | `String`: the new month strings. <br /> |
| `context` | `int`: The formatting context, FORMAT or STANDALONE. <br /> |
| `width` | `int`: The width of the month string, either WIDE, ABBREVIATED, or NARROW. <br /> |

### setNarrowEras

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setNarrowEras (String[] newNarrowEras)
```

**\[icu\]** Sets narrow era name strings. For example: "A" and "B".

<br />

| Parameters ||
|---|---|
| `newNarrowEras` | `String`: the new narrow era strings. <br /> |

### setQuarters

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setQuarters (String[] newQuarters, 
                int context, 
                int width)
```

**\[icu\]** Sets quarter strings. For example: "1st Quarter", "2nd Quarter", etc.

<br />

| Parameters ||
|---|---|
| `newQuarters` | `String`: the new quarter strings. <br /> |
| `context` | `int`: The formatting context, FORMAT or STANDALONE. <br /> |
| `width` | `int`: The width of the quarter string, WIDE, NARROW, or ABBREVIATED. <br /> |

### setShortMonths

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setShortMonths (String[] newShortMonths)
```

Sets short month strings. For example: "Jan", "Feb", etc.

<br />

| Parameters ||
|---|---|
| `newShortMonths` | `String`: the new short month strings. <br /> |

### setShortWeekdays

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setShortWeekdays (String[] newAbbrevWeekdays)
```

Sets abbreviated weekday strings; for example: "Sun", "Mon", etc. (Note: the method name is misleading; it does not set the CLDR-style "short" weekday strings, e.g. "Su", "Mo", etc.)

<br />

| Parameters ||
|---|---|
| `newAbbrevWeekdays` | `String`: the new abbreviated weekday strings. The array should be indexed by `Calendar.SUNDAY`, `Calendar.MONDAY`, etc. <br /> |

### setWeekdays

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setWeekdays (String[] newWeekdays)
```

Sets wide weekday strings. For example: "Sunday", "Monday", etc.

<br />

| Parameters ||
|---|---|
| `newWeekdays` | `String`: the new weekday strings. The array should be indexed by `Calendar.SUNDAY`, `Calendar.MONDAY`, etc. <br /> |

### setWeekdays

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setWeekdays (String[] newWeekdays, 
                int context, 
                int width)
```

Sets weekday strings. For example: "Sunday", "Monday", etc.

<br />

| Parameters ||
|---|---|
| `newWeekdays` | `String`: The new weekday strings. <br /> |
| `context` | `int`: The formatting context, FORMAT or STANDALONE. <br /> |
| `width` | `int`: The width of the strings, either WIDE, ABBREVIATED, SHORT, or NARROW. <br /> |

### setYearNames

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setYearNames (String[] yearNames, 
                int context, 
                int width)
```

Sets cyclic year name strings, for example: "jia-zi", "yi-chou", etc.

<br />

| Parameters ||
|---|---|
| `yearNames` | `String`: The new cyclic year name strings. <br /> |
| `context` | `int`: The usage context: FORMAT, STANDALONE (currently only FORMAT is supported). <br /> |
| `width` | `int`: The name width: WIDE, ABBREVIATED, NARROW (currently only ABBREVIATED is supported). <br /> |

### setZodiacNames

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setZodiacNames (String[] zodiacNames, 
                int context, 
                int width)
```

Sets calendar zodiac name strings, for example: "Rat", "Ox", "Tiger", etc.

<br />

| Parameters ||
|---|---|
| `zodiacNames` | `String`: The new zodiac name strings. <br /> |
| `context` | `int`: The usage context: FORMAT, STANDALONE (currently only FORMAT is supported). <br /> |
| `width` | `int`: The name width: WIDE, ABBREVIATED, NARROW (currently only ABBREVIATED is supported). <br /> |

### setZoneStrings

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setZoneStrings (String[][] newZoneStrings)
```

Sets time zone strings.

**Note** : `https://developer.android.com/reference/android/icu/text/SimpleDateFormat` no longer uses the zone strings stored in a `DateFormatSymbols`. Therefore, the time zone strings set by this method have no effects in an instance of `SimpleDateFormat` for formatting time zones. If you want to customize time zone display names formatted by `SimpleDateFormat`, you should customize `https://developer.android.com/reference/android/icu/text/TimeZoneFormat` and set the instance by `https://developer.android.com/reference/android/icu/text/SimpleDateFormat#setTimeZoneFormat(android.icu.text.TimeZoneFormat)` instead.

<br />

| Parameters ||
|---|---|
| `newZoneStrings` | `String`: the new time zone strings. <br /> |

## Protected methods

### initializeData

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void initializeData (ULocale desiredLocale, 
                String type)
```

Initializes format symbols for the locale and calendar type

<br />

| Parameters ||
|---|---|
| `desiredLocale` | `ULocale`: The locale whose symbols are desired. <br /> |
| `type` | `String`: The calendar type whose date format symbols are desired. <br /> |