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

# TimeZoneFormat

*** ** * ** ***


`
public


class
TimeZoneFormat
`


`


`

`


`

`

extends https://developer.android.com/reference/android/icu/text/UFormat


`

`


implements

https://developer.android.com/reference/android/icu/util/Freezable<https://developer.android.com/reference/android/icu/text/TimeZoneFormat>,

https://developer.android.com/reference/java/io/Serializable


`

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

<br />

*** ** * ** ***

`TimeZoneFormat` supports time zone display name formatting and parsing.
An instance of TimeZoneFormat works as a subformatter of `https://developer.android.com/reference/android/icu/text/SimpleDateFormat`,
but you can also directly get a new instance of `TimeZoneFormat` and
formatting/parsing time zone display names.


ICU implements the time zone display names defined by [UTS#35
Unicode Locale Data Markup Language (LDML)](http://www.unicode.org/reports/tr35/). `https://developer.android.com/reference/android/icu/text/TimeZoneNames` represents the
time zone display name data model and this class implements the algorithm for actual
formatting and parsing.
**See also:**

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

## Summary

| ### Protected constructors ||
|---|---|
| ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#TimeZoneFormat(android.icu.util.ULocale)(https://developer.android.com/reference/android/icu/util/ULocale locale) ` The protected constructor for subclassing. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#clone()() ` Creates and returns a copy of this object. |
| ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#cloneAsThawed()() ` Provides for the clone operation. |
| ` https://developer.android.com/reference/java/lang/StringBuffer` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#format(java.lang.Object,%20java.lang.StringBuffer,%20java.text.FieldPosition)(https://developer.android.com/reference/java/lang/Object obj, https://developer.android.com/reference/java/lang/StringBuffer toAppendTo, https://developer.android.com/reference/java/text/FieldPosition pos) ` Formats an object and appends the resulting text to a given string buffer. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#format(android.icu.text.TimeZoneFormat.Style,%20android.icu.util.TimeZone,%20long,%20android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>)(https://developer.android.com/reference/android/icu/text/TimeZoneFormat.Style style, https://developer.android.com/reference/android/icu/util/TimeZone tz, long date, https://developer.android.com/reference/android/icu/util/Output<https://developer.android.com/reference/android/icu/text/TimeZoneFormat.TimeType> timeType) ` Returns the display name of the time zone at the given date for the style. |
| ` final https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#format(android.icu.text.TimeZoneFormat.Style,%20android.icu.util.TimeZone,%20long)(https://developer.android.com/reference/android/icu/text/TimeZoneFormat.Style style, https://developer.android.com/reference/android/icu/util/TimeZone tz, long date) ` Returns the display name of the time zone at the given date for the style. |
| ` final https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#formatOffsetISO8601Basic(int,%20boolean,%20boolean,%20boolean)(int offset, boolean useUtcIndicator, boolean isShort, boolean ignoreSeconds) ` Returns the ISO 8601 basic time zone string for the given offset. |
| ` final https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#formatOffsetISO8601Extended(int,%20boolean,%20boolean,%20boolean)(int offset, boolean useUtcIndicator, boolean isShort, boolean ignoreSeconds) ` Returns the ISO 8601 extended time zone string for the given offset. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#formatOffsetLocalizedGMT(int)(int offset) ` Returns the localized GMT(UTC) offset format for the given offset. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#formatOffsetShortLocalizedGMT(int)(int offset) ` Returns the short localized GMT(UTC) offset format for the given offset. |
| ` https://developer.android.com/reference/java/text/AttributedCharacterIterator` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#formatToCharacterIterator(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Formats an Object producing an `AttributedCharacterIterator`. |
| ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#freeze()() ` Freezes the object. |
| ` https://developer.android.com/reference/java/util/EnumSet<https://developer.android.com/reference/android/icu/text/TimeZoneFormat.ParseOption>` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getDefaultParseOptions()() ` Returns the default parse options used by this `TimeZoneFormat` instance. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTOffsetDigits()() ` Returns the decimal digit characters used for localized GMT format in a single string containing from 0 to 9 in the ascending order. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTOffsetPattern(android.icu.text.TimeZoneFormat.GMTOffsetPatternType)(https://developer.android.com/reference/android/icu/text/TimeZoneFormat.GMTOffsetPatternType type) ` Returns the offset pattern used for localized GMT format. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTPattern()() ` Returns the localized GMT format pattern. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTZeroFormat()() ` Returns the localized GMT format string for GMT(UTC) itself (GMT offset is 0). |
| ` static https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getInstance(java.util.Locale)(https://developer.android.com/reference/java/util/Locale locale) ` Returns a frozen instance of `TimeZoneFormat` for the given `https://developer.android.com/reference/java/util/Locale`. |
| ` static https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getInstance(android.icu.util.ULocale)(https://developer.android.com/reference/android/icu/util/ULocale locale) ` Returns a frozen instance of `TimeZoneFormat` for the given locale. |
| ` https://developer.android.com/reference/android/icu/text/TimeZoneNames` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getTimeZoneNames()() ` Returns the time zone display name data used by this instance. |
| ` boolean` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#isFrozen()() ` Determines whether the object has been frozen or not. |
| ` final https://developer.android.com/reference/android/icu/util/TimeZone` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parse(java.lang.String)(https://developer.android.com/reference/java/lang/String text) ` Returns a `TimeZone` for the given text. |
| ` final https://developer.android.com/reference/android/icu/util/TimeZone` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parse(java.lang.String,%20java.text.ParsePosition)(https://developer.android.com/reference/java/lang/String text, https://developer.android.com/reference/java/text/ParsePosition pos) ` Returns a `TimeZone` by parsing the time zone string according to the given parse position. |
| ` https://developer.android.com/reference/android/icu/util/TimeZone` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parse(android.icu.text.TimeZoneFormat.Style,%20java.lang.String,%20java.text.ParsePosition,%20android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>)(https://developer.android.com/reference/android/icu/text/TimeZoneFormat.Style style, https://developer.android.com/reference/java/lang/String text, https://developer.android.com/reference/java/text/ParsePosition pos, https://developer.android.com/reference/android/icu/util/Output<https://developer.android.com/reference/android/icu/text/TimeZoneFormat.TimeType> timeType) ` Returns a `TimeZone` by parsing the time zone string according to the parse position, the style and the default parse options. |
| ` https://developer.android.com/reference/android/icu/util/TimeZone` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parse(android.icu.text.TimeZoneFormat.Style,%20java.lang.String,%20java.text.ParsePosition,%20java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption>,%20android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>)(https://developer.android.com/reference/android/icu/text/TimeZoneFormat.Style style, https://developer.android.com/reference/java/lang/String text, https://developer.android.com/reference/java/text/ParsePosition pos, https://developer.android.com/reference/java/util/EnumSet<https://developer.android.com/reference/android/icu/text/TimeZoneFormat.ParseOption> options, https://developer.android.com/reference/android/icu/util/Output<https://developer.android.com/reference/android/icu/text/TimeZoneFormat.TimeType> timeType) ` Returns a `TimeZone` by parsing the time zone string according to the parse position, the style and the parse options. |
| ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parseObject(java.lang.String,%20java.text.ParsePosition)(https://developer.android.com/reference/java/lang/String source, https://developer.android.com/reference/java/text/ParsePosition pos) ` Parses text from a string to produce an object. |
| ` final int` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parseOffsetISO8601(java.lang.String,%20java.text.ParsePosition)(https://developer.android.com/reference/java/lang/String text, https://developer.android.com/reference/java/text/ParsePosition pos) ` Returns offset from GMT(UTC) in milliseconds for the given ISO 8601 basic or extended time zone string. |
| ` int` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parseOffsetLocalizedGMT(java.lang.String,%20java.text.ParsePosition)(https://developer.android.com/reference/java/lang/String text, https://developer.android.com/reference/java/text/ParsePosition pos) ` Returns offset from GMT(UTC) in milliseconds for the given localized GMT offset format string. |
| ` int` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parseOffsetShortLocalizedGMT(java.lang.String,%20java.text.ParsePosition)(https://developer.android.com/reference/java/lang/String text, https://developer.android.com/reference/java/text/ParsePosition pos) ` Returns offset from GMT(UTC) in milliseconds for the given short localized GMT offset format string. |
| ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#setDefaultParseOptions(java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption>)(https://developer.android.com/reference/java/util/EnumSet<https://developer.android.com/reference/android/icu/text/TimeZoneFormat.ParseOption> options) ` Sets the default parse options. |
| ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#setGMTOffsetDigits(java.lang.String)(https://developer.android.com/reference/java/lang/String digits) ` Sets the decimal digit characters used for localized GMT format. |
| ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#setGMTOffsetPattern(android.icu.text.TimeZoneFormat.GMTOffsetPatternType,%20java.lang.String)(https://developer.android.com/reference/android/icu/text/TimeZoneFormat.GMTOffsetPatternType type, https://developer.android.com/reference/java/lang/String pattern) ` Sets the offset pattern for the given offset type. |
| ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#setGMTPattern(java.lang.String)(https://developer.android.com/reference/java/lang/String pattern) ` Sets the localized GMT format pattern. |
| ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#setGMTZeroFormat(java.lang.String)(https://developer.android.com/reference/java/lang/String gmtZeroFormat) ` Sets the localized GMT format string for GMT(UTC) itself (GMT offset is 0). |
| ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | ` https://developer.android.com/reference/android/icu/text/TimeZoneFormat#setTimeZoneNames(android.icu.text.TimeZoneNames)(https://developer.android.com/reference/android/icu/text/TimeZoneNames tznames) ` Sets the time zone display name data to this instance. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/text/Format ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/text/Format#clone()() ` Creates and returns a copy of this object. | | ` final https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/text/Format#format(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Formats an object to produce a string. | | ` abstract https://developer.android.com/reference/java/lang/StringBuffer` | ` https://developer.android.com/reference/java/text/Format#format(java.lang.Object,%20java.lang.StringBuffer,%20java.text.FieldPosition)(https://developer.android.com/reference/java/lang/Object obj, https://developer.android.com/reference/java/lang/StringBuffer toAppendTo, https://developer.android.com/reference/java/text/FieldPosition pos) ` Formats an object and appends the resulting text to a given string buffer. | | ` https://developer.android.com/reference/java/text/AttributedCharacterIterator` | ` https://developer.android.com/reference/java/text/Format#formatToCharacterIterator(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Formats an Object producing an `AttributedCharacterIterator`. | | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/text/Format#parseObject(java.lang.String)(https://developer.android.com/reference/java/lang/String source) ` Parses text from the beginning of the given string to produce an object. | | ` abstract https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/text/Format#parseObject(java.lang.String,%20java.text.ParsePosition)(https://developer.android.com/reference/java/lang/String source, https://developer.android.com/reference/java/text/ParsePosition pos) ` Parses text from a string to produce an object. | ||
| 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*. | ||
| From interface ` https://developer.android.com/reference/android/icu/util/Freezable ` |---|---| | ` abstract https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | ` https://developer.android.com/reference/android/icu/util/Freezable#cloneAsThawed()() ` Provides for the clone operation. | | ` abstract https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | ` https://developer.android.com/reference/android/icu/util/Freezable#freeze()() ` Freezes the object. | | ` abstract boolean` | ` https://developer.android.com/reference/android/icu/util/Freezable#isFrozen()() ` Determines whether the object has been frozen or not. | ||

## Protected constructors

### TimeZoneFormat

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

```
protected TimeZoneFormat (ULocale locale)
```

The protected constructor for subclassing.

<br />

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

## Public methods

### clone

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

```
public Object clone ()
```

Creates and returns a copy of this object.

<br />

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

### cloneAsThawed

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

```
public TimeZoneFormat cloneAsThawed ()
```

Provides for the clone operation. Any clone is initially unfrozen.

<br />

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

### format

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

```
public StringBuffer format (Object obj, 
                StringBuffer toAppendTo, 
                FieldPosition pos)
```

Formats an object and appends the resulting text to a given string
buffer.
If the `pos` argument identifies a field used by the format,
then its indices are set to the beginning and end of the first such
field encountered.

<br />

| Parameters ||
|---|---|
| `obj` | `Object`: The object to format <br /> |
| `toAppendTo` | `StringBuffer`: where the text is to be appended <br /> |
| `pos` | `FieldPosition`: A `FieldPosition` identifying a field in the formatted text <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/StringBuffer` | the string buffer passed in as `toAppendTo`, with formatted text appended <br /> |

### format

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

```
public String format (TimeZoneFormat.Style style, 
                TimeZone tz, 
                long date, 
                Output<TimeZoneFormat.TimeType> timeType)
```

Returns the display name of the time zone at the given date for
the style. This method takes an extra argument `Output<TimeType> timeType`
in addition to the argument list of `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#format(android.icu.text.TimeZoneFormat.Style,%20android.icu.util.TimeZone,%20long)`.
The argument is used for receiving the time type (standard time
or daylight saving time, or unknown) actually used for the display name.

<br />

| Parameters ||
|---|---|
| `style` | `TimeZoneFormat.Style`: the style enum (e.g. `GENERIC_LONG`, `LOCALIZED_GMT`...) <br /> |
| `tz` | `TimeZone`: the time zone. <br /> |
| `date` | `long`: the date. <br /> |
| `timeType` | `Output`: the output argument for receiving the time type (standard/daylight/unknown) used for the display name, or specify null if the information is not necessary. <br /> |

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

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat.Style`
- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#format(android.icu.text.TimeZoneFormat.Style,%20android.icu.util.TimeZone,%20long)`

### format

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

```
public final String format (TimeZoneFormat.Style style, 
                TimeZone tz, 
                long date)
```

Returns the display name of the time zone at the given date for
the style.

**Note** : A style may have fallback styles defined. For example,
when `GENERIC_LONG` is requested, but there is no display name
data available for `GENERIC_LONG` style, the implementation
may use `GENERIC_LOCATION` or `LOCALIZED_GMT`.
See UTS#35 UNICODE LOCALE DATA MARKUP LANGUAGE (LDML)
[Appendix J: Time Zone Display Name](http://www.unicode.org/reports/tr35/#Time_Zone_Fallback)
for the details.

<br />

| Parameters ||
|---|---|
| `style` | `TimeZoneFormat.Style`: the style enum (e.g. `GENERIC_LONG`, `LOCALIZED_GMT`...) <br /> |
| `tz` | `TimeZone`: the time zone. <br /> |
| `date` | `long`: the date. <br /> |

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

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat.Style`
- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#format(android.icu.text.TimeZoneFormat.Style,%20android.icu.util.TimeZone,%20long,%20android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>)`

### formatOffsetISO8601Basic

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

```
public final String formatOffsetISO8601Basic (int offset, 
                boolean useUtcIndicator, 
                boolean isShort, 
                boolean ignoreSeconds)
```

Returns the ISO 8601 basic time zone string for the given offset.
For example, "-08", "-0830" and "Z"

<br />

| Parameters ||
|---|---|
| `offset` | `int`: the offset from GMT(UTC) in milliseconds. <br /> |
| `useUtcIndicator` | `boolean`: true if ISO 8601 UTC indicator "Z" is used when the offset is 0. <br /> |
| `isShort` | `boolean`: true if shortest form is used. <br /> |
| `ignoreSeconds` | `boolean`: true if non-zero offset seconds is appended. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the ISO 8601 basic format. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the specified offset is out of supported range (-24 hours \< offset \< +24 hours). |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#formatOffsetISO8601Extended(int,%20boolean,%20boolean,%20boolean)`
- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parseOffsetISO8601(java.lang.String,%20java.text.ParsePosition)`

### formatOffsetISO8601Extended

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

```
public final String formatOffsetISO8601Extended (int offset, 
                boolean useUtcIndicator, 
                boolean isShort, 
                boolean ignoreSeconds)
```

Returns the ISO 8601 extended time zone string for the given offset.
For example, "-08:00", "-08:30" and "Z"

<br />

| Parameters ||
|---|---|
| `offset` | `int`: the offset from GMT(UTC) in milliseconds. <br /> |
| `useUtcIndicator` | `boolean`: true if ISO 8601 UTC indicator "Z" is used when the offset is 0. <br /> |
| `isShort` | `boolean`: true if shortest form is used. <br /> |
| `ignoreSeconds` | `boolean`: true if non-zero offset seconds is appended. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the ISO 8601 extended format. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the specified offset is out of supported range (-24 hours \< offset \< +24 hours). |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#formatOffsetISO8601Basic(int,%20boolean,%20boolean,%20boolean)`
- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parseOffsetISO8601(java.lang.String,%20java.text.ParsePosition)`

### formatOffsetLocalizedGMT

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

```
public String formatOffsetLocalizedGMT (int offset)
```

Returns the localized GMT(UTC) offset format for the given offset.
The localized GMT offset is defined by;

- GMT format pattern (e.g. "GMT {0}" - see `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTPattern()`)
- Offset time pattern (e.g. "+HH:mm" - see `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTOffsetPattern(android.icu.text.TimeZoneFormat.GMTOffsetPatternType)`)
- Offset digits (e.g. "0123456789" - see `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTOffsetDigits()`)
- GMT zero format (e.g. "GMT" - see `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTZeroFormat()`)

This format always uses 2 digit hours and minutes. When the given offset has non-zero seconds, 2 digit seconds field will be appended. For example, GMT+05:00 and GMT+05:28:06.

<br />

<br />

| Parameters ||
|---|---|
| `offset` | `int`: the offset from GMT(UTC) in milliseconds. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the localized GMT format string <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the specified offset is out of supported range (-24 hours \< offset \< +24 hours). |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parseOffsetLocalizedGMT(java.lang.String,%20java.text.ParsePosition)`

### formatOffsetShortLocalizedGMT

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

```
public String formatOffsetShortLocalizedGMT (int offset)
```

Returns the short localized GMT(UTC) offset format for the given offset.
The short localized GMT offset is defined by;

- GMT format pattern (e.g. "GMT {0}" - see `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTPattern()`)
- Offset time pattern (e.g. "+HH:mm" - see `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTOffsetPattern(android.icu.text.TimeZoneFormat.GMTOffsetPatternType)`)
- Offset digits (e.g. "0123456789" - see `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTOffsetDigits()`)
- GMT zero format (e.g. "GMT" - see `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTZeroFormat()`)

This format uses the shortest representation of offset. The hours field does not have leading zero and lower fields with zero will be truncated. For example, GMT+5 and GMT+530.

<br />

<br />

| Parameters ||
|---|---|
| `offset` | `int`: the offset from GMT(UTC) in milliseconds. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the short localized GMT format string <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the specified offset is out of supported range (-24 hours \< offset \< +24 hours). |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parseOffsetLocalizedGMT(java.lang.String,%20java.text.ParsePosition)`

### formatToCharacterIterator

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

```
public AttributedCharacterIterator formatToCharacterIterator (Object obj)
```

Formats an Object producing an `AttributedCharacterIterator`.
You can use the returned `AttributedCharacterIterator`
to build the resulting String, as well as to determine information
about the resulting String.


Each attribute key of the AttributedCharacterIterator will be of type
`Field`. It is up to each `Format` implementation
to define what the legal values are for each attribute in the
`AttributedCharacterIterator`, but typically the attribute
key is also used as the attribute value.

The default implementation creates an
`AttributedCharacterIterator` with no attributes. Subclasses
that support fields should override this and create an
`AttributedCharacterIterator` with meaningful attributes.

<br />

| Parameters ||
|---|---|
| `obj` | `Object`: The object to format <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/text/AttributedCharacterIterator` | AttributedCharacterIterator describing the formatted value. <br /> |

### freeze

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

```
public TimeZoneFormat freeze ()
```

Freezes the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | the object itself. <br /> |

### getDefaultParseOptions

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

```
public EnumSet<TimeZoneFormat.ParseOption> getDefaultParseOptions ()
```

Returns the default parse options used by this `TimeZoneFormat` instance.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/EnumSet<https://developer.android.com/reference/android/icu/text/TimeZoneFormat.ParseOption>` | the default parse options. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat.ParseOption`

### getGMTOffsetDigits

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

```
public String getGMTOffsetDigits ()
```

Returns the decimal digit characters used for localized GMT format in a single string
containing from 0 to 9 in the ascending order.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the decimal digits for localized GMT format. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#setGMTOffsetDigits(java.lang.String)`

### getGMTOffsetPattern

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

```
public String getGMTOffsetPattern (TimeZoneFormat.GMTOffsetPatternType type)
```

Returns the offset pattern used for localized GMT format.

<br />

| Parameters ||
|---|---|
| `type` | `TimeZoneFormat.GMTOffsetPatternType`: the offset pattern enum <br /> |

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

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#setGMTOffsetPattern(android.icu.text.TimeZoneFormat.GMTOffsetPatternType,%20java.lang.String)`

### getGMTPattern

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

```
public String getGMTPattern ()
```

Returns the localized GMT format pattern.

<br />

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

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#setGMTPattern(java.lang.String)`

### getGMTZeroFormat

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

```
public String getGMTZeroFormat ()
```

Returns the localized GMT format string for GMT(UTC) itself (GMT offset is 0).

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the localized GMT string string for GMT(UTC) itself. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#setGMTZeroFormat(java.lang.String)`

### getInstance

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

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

Returns a frozen instance of `TimeZoneFormat` for the given
`https://developer.android.com/reference/java/util/Locale`.

**Note** : The instance returned by this method is frozen. If you want to
customize a TimeZoneFormat, you must use `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#cloneAsThawed()` to get a
thawed copy first.

<br />

| Parameters ||
|---|---|
| `locale` | `Locale`: the `https://developer.android.com/reference/java/util/Locale`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | a frozen instance of `TimeZoneFormat` for the given locale. <br /> |

### getInstance

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

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

Returns a frozen instance of `TimeZoneFormat` for the given locale.

**Note** : The instance returned by this method is frozen. If you want to
customize a TimeZoneFormat, you must use `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#cloneAsThawed()` to get a
thawed copy first.

<br />

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

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | a frozen instance of `TimeZoneFormat` for the given locale. <br /> |

### getTimeZoneNames

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

```
public TimeZoneNames getTimeZoneNames ()
```

Returns the time zone display name data used by this instance.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/TimeZoneNames` | the time zone display name data. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#setTimeZoneNames(android.icu.text.TimeZoneNames)`

### isFrozen

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

```
public boolean isFrozen ()
```

Determines whether the object has been frozen or not.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### parse

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

```
public final TimeZone parse (String text)
```

Returns a `TimeZone` for the given text.


**Note** : The behavior of this method is equivalent to `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parse(java.lang.String,%20java.text.ParsePosition)`.

<br />

| Parameters ||
|---|---|
| `text` | `String`: the time zone string <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/util/TimeZone` | A `TimeZone`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/text/ParseException` | when the input could not be parsed as a time zone string. |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parse(java.lang.String,%20java.text.ParsePosition)`

### parse

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

```
public final TimeZone parse (String text, 
                ParsePosition pos)
```

Returns a `TimeZone` by parsing the time zone string according to
the given parse position.


**Note** : This method is equivalent to `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parse(android.icu.text.TimeZoneFormat.Style,%20java.lang.String,%20java.text.ParsePosition,%20java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption>,%20android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>)`.

<br />

| Parameters ||
|---|---|
| `text` | `String`: the text contains a time zone string at the position. <br /> |
| `pos` | `ParsePosition`: the position. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/util/TimeZone` | A `TimeZone`, or null if the input could not be parsed. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parse(android.icu.text.TimeZoneFormat.Style,%20java.lang.String,%20java.text.ParsePosition,%20java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption>,%20android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>)`

### parse

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

```
public TimeZone parse (TimeZoneFormat.Style style, 
                String text, 
                ParsePosition pos, 
                Output<TimeZoneFormat.TimeType> timeType)
```

Returns a `TimeZone` by parsing the time zone string according to
the parse position, the style and the default parse options.


**Note** : This method is equivalent to `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parse(android.icu.text.TimeZoneFormat.Style,%20java.lang.String,%20java.text.ParsePosition,%20java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption>,%20android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>)`.

<br />

| Parameters ||
|---|---|
| `style` | `TimeZoneFormat.Style`: the format style <br /> |
| `text` | `String`: the text contains a time zone string at the position. <br /> |
| `pos` | `ParsePosition`: the position. <br /> |
| `timeType` | `Output`: The output argument for receiving the time type (standard/daylight/unknown), or specify null if the information is not necessary. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/util/TimeZone` | A `TimeZone`, or null if the input could not be parsed. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat.Style`
- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#parse(android.icu.text.TimeZoneFormat.Style,%20java.lang.String,%20java.text.ParsePosition,%20java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption>,%20android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>)`
- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#format(android.icu.text.TimeZoneFormat.Style,%20android.icu.util.TimeZone,%20long,%20android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>)`
- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#setDefaultParseOptions(java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption>)`

### parse

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

```
public TimeZone parse (TimeZoneFormat.Style style, 
                String text, 
                ParsePosition pos, 
                EnumSet<TimeZoneFormat.ParseOption> options, 
                Output<TimeZoneFormat.TimeType> timeType)
```

Returns a `TimeZone` by parsing the time zone string according to
the parse position, the style and the parse options.

<br />

| Parameters ||
|---|---|
| `style` | `TimeZoneFormat.Style`: the format style. <br /> |
| `text` | `String`: the text contains a time zone string at the position. <br /> |
| `pos` | `ParsePosition`: the position. <br /> |
| `options` | `EnumSet`: the parse options. <br /> |
| `timeType` | `Output`: The output argument for receiving the time type (standard/daylight/unknown), or specify null if the information is not necessary. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/util/TimeZone` | A `TimeZone`, or null if the input could not be parsed. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat.Style`
- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#format(android.icu.text.TimeZoneFormat.Style,%20android.icu.util.TimeZone,%20long,%20android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>)`

### parseObject

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

```
public Object parseObject (String source, 
                ParsePosition pos)
```

Parses text from a string to produce an object.


The method attempts to parse text starting at the index given by
`pos`.
If parsing succeeds, then the index of `pos` is updated
to the index after the last character used (parsing does not necessarily
use all characters up to the end of the string), and the parsed
object is returned. The updated `pos` can be used to
indicate the starting point for the next call to this method.
If an error occurs, then the index of `pos` is not
changed, the error index of `pos` is set to the index of
the character where the error occurred, and null is returned.

<br />

| Parameters ||
|---|---|
| `source` | `String`: A `String`, part of which should be parsed. <br /> |
| `pos` | `ParsePosition`: A `ParsePosition` object with index and error index information as described above. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/Object` | An `Object` parsed from the string. In case of error, returns null. <br /> |

### parseOffsetISO8601

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

```
public final int parseOffsetISO8601 (String text, 
                ParsePosition pos)
```

Returns offset from GMT(UTC) in milliseconds for the given ISO 8601
basic or extended time zone string. When the given string is not an ISO 8601 time
zone string, this method sets the current position as the error index
to `ParsePosition pos` and returns 0.

<br />

| Parameters ||
|---|---|
| `text` | `String`: the text contains ISO 8601 style time zone string (e.g. "-08", "-0800", "-08:00", and "Z") at the position. <br /> |
| `pos` | `ParsePosition`: the position. <br /> |

| Returns ||
|---|---|
| `int` | the offset from GMT(UTC) in milliseconds for the given ISO 8601 style time zone string. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#formatOffsetISO8601Basic(int,%20boolean,%20boolean,%20boolean)`
- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#formatOffsetISO8601Extended(int,%20boolean,%20boolean,%20boolean)`

### parseOffsetLocalizedGMT

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

```
public int parseOffsetLocalizedGMT (String text, 
                ParsePosition pos)
```

Returns offset from GMT(UTC) in milliseconds for the given localized GMT
offset format string. When the given string cannot be parsed, this method
sets the current position as the error index to `ParsePosition pos`
and returns 0.

<br />

| Parameters ||
|---|---|
| `text` | `String`: the text contains a localized GMT offset string at the position. <br /> |
| `pos` | `ParsePosition`: the position. <br /> |

| Returns ||
|---|---|
| `int` | the offset from GMT(UTC) in milliseconds for the given localized GMT offset format string. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#formatOffsetLocalizedGMT(int)`

### parseOffsetShortLocalizedGMT

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

```
public int parseOffsetShortLocalizedGMT (String text, 
                ParsePosition pos)
```

Returns offset from GMT(UTC) in milliseconds for the given short localized GMT
offset format string. When the given string cannot be parsed, this method
sets the current position as the error index to `ParsePosition pos`
and returns 0.

<br />

| Parameters ||
|---|---|
| `text` | `String`: the text contains a short localized GMT offset string at the position. <br /> |
| `pos` | `ParsePosition`: the position. <br /> |

| Returns ||
|---|---|
| `int` | the offset from GMT(UTC) in milliseconds for the given short localized GMT offset format string. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#formatOffsetShortLocalizedGMT(int)`

### setDefaultParseOptions

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

```
public TimeZoneFormat setDefaultParseOptions (EnumSet<TimeZoneFormat.ParseOption> options)
```

Sets the default parse options.


**Note:** By default, an instance of `TimeZoneFormat`
created by `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getInstance(android.icu.util.ULocale)` has no parse options set.

<br />

| Parameters ||
|---|---|
| `options` | `EnumSet`: the default parse options. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | this object. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat.ParseOption`

### setGMTOffsetDigits

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

```
public TimeZoneFormat setGMTOffsetDigits (String digits)
```

Sets the decimal digit characters used for localized GMT format.

<br />

| Parameters ||
|---|---|
| `digits` | `String`: a string contains the decimal digit characters from 0 to 9 n the ascending order. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | this object. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | when the string did not contain ten characters. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | when this object is frozen. |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTOffsetDigits()`

### setGMTOffsetPattern

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

```
public TimeZoneFormat setGMTOffsetPattern (TimeZoneFormat.GMTOffsetPatternType type, 
                String pattern)
```

Sets the offset pattern for the given offset type.

<br />

| Parameters ||
|---|---|
| `type` | `TimeZoneFormat.GMTOffsetPatternType`: the offset pattern. <br /> |
| `pattern` | `String`: the pattern string. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | this object. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | when the pattern string does not have required time field letters. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | when this object is frozen. |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTOffsetPattern(android.icu.text.TimeZoneFormat.GMTOffsetPatternType)`

### setGMTPattern

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

```
public TimeZoneFormat setGMTPattern (String pattern)
```

Sets the localized GMT format pattern. The pattern must contain
a single argument {0}, for example "GMT {0}".

<br />

| Parameters ||
|---|---|
| `pattern` | `String`: the localized GMT format pattern string <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | this object. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | when the pattern string does not contain "{0}" |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | when this object is frozen. |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTPattern()`

### setGMTZeroFormat

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

```
public TimeZoneFormat setGMTZeroFormat (String gmtZeroFormat)
```

Sets the localized GMT format string for GMT(UTC) itself (GMT offset is 0).

<br />

| Parameters ||
|---|---|
| `gmtZeroFormat` | `String`: the localized GMT format string for GMT(UTC). <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | this object. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | when this object is frozen. |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getGMTZeroFormat()`

### setTimeZoneNames

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

```
public TimeZoneFormat setTimeZoneNames (TimeZoneNames tznames)
```

Sets the time zone display name data to this instance.

<br />

| Parameters ||
|---|---|
| `tznames` | `TimeZoneNames`: the time zone display name data. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/TimeZoneFormat` | this object. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | when this object is frozen. |

**See also:**

- `https://developer.android.com/reference/android/icu/text/TimeZoneFormat#getTimeZoneNames()`