Share via


TimeZoneNames.GetExemplarLocationName(String) Method

Definition

Returns the exemplar location name for the given time zone.

[Android.Runtime.Register("getExemplarLocationName", "(Ljava/lang/String;)Ljava/lang/String;", "GetGetExemplarLocationName_Ljava_lang_String_Handler", ApiSince=24)]
public virtual string? GetExemplarLocationName (string? tzID);
[<Android.Runtime.Register("getExemplarLocationName", "(Ljava/lang/String;)Ljava/lang/String;", "GetGetExemplarLocationName_Ljava_lang_String_Handler", ApiSince=24)>]
abstract member GetExemplarLocationName : string -> string
override this.GetExemplarLocationName : string -> string

Parameters

tzID
String

The canonical time zone ID

Returns

The exemplar location name for the given time zone, or null when a localized location name is not available and the fallback logic described above cannot extract location from the ID.

Attributes

Remarks

Returns the exemplar location name for the given time zone. When this object does not have a localized location name, the default implementation may still returns a programmatically generated name with the logic described below. <ol> <li>Check if the ID contains "/". If not, return null. <li>Check if the ID does not start with "Etc/" or "SystemV/". If it does, return null. <li>Extract a substring after the last occurrence of "/". <li>Replace "_" with " ". </ol> For example, "New York" is returned for the time zone ID "America/New_York" when this object does not have the localized location name.

Java documentation for android.icu.text.TimeZoneNames.getExemplarLocationName(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to