Sdílet prostřednictvím


TimeZone.GetDisplayName Method

Definition

Overloads

GetDisplayName(Locale)

Returns a long standard time name of this TimeZone suitable for presentation to the user in the specified locale.

GetDisplayName(Boolean, TimeZoneStyle)

Returns a name in the specified style of this TimeZone suitable for presentation to the user in the default locale.

GetDisplayName(Boolean, TimeZoneStyle, Locale)

Returns the #SHORT short or #LONG long name of this time zone with either standard or daylight time, as written in locale.

GetDisplayName(Locale)

Returns a long standard time name of this TimeZone suitable for presentation to the user in the specified locale.

[Android.Runtime.Register("getDisplayName", "(Ljava/util/Locale;)Ljava/lang/String;", "")]
public string? GetDisplayName (Java.Util.Locale? locale);
[<Android.Runtime.Register("getDisplayName", "(Ljava/util/Locale;)Ljava/lang/String;", "")>]
member this.GetDisplayName : Java.Util.Locale -> string

Parameters

locale
Locale

the locale in which to supply the display name.

Returns

the human-readable name of this time zone in the given locale.

Attributes

Remarks

Returns a long standard time name of this TimeZone suitable for presentation to the user in the specified locale.

This method is equivalent to: <blockquote>

getDisplayName(false, {@link #LONG}, locale)

</blockquote>

Added in 1.2.

Java documentation for java.util.TimeZone.getDisplayName(java.util.Locale).

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

GetDisplayName(Boolean, TimeZoneStyle)

Returns a name in the specified style of this TimeZone suitable for presentation to the user in the default locale.

[Android.Runtime.Register("getDisplayName", "(ZI)Ljava/lang/String;", "")]
public string? GetDisplayName (bool daylight, Java.Util.TimeZoneStyle style);
[<Android.Runtime.Register("getDisplayName", "(ZI)Ljava/lang/String;", "")>]
member this.GetDisplayName : bool * Java.Util.TimeZoneStyle -> string

Parameters

daylight
Boolean

true specifying a Daylight Saving Time name, or false specifying a Standard Time name

style
TimeZoneStyle

either #LONG or #SHORT

Returns

the human-readable name of this time zone in the default locale.

Attributes

Remarks

Returns a name in the specified style of this TimeZone suitable for presentation to the user in the default locale. If the specified daylight is true, a Daylight Saving Time name is returned (even if this TimeZone doesn't observe Daylight Saving Time). Otherwise, a Standard Time name is returned.

This method is equivalent to: <blockquote>

getDisplayName(daylight, style,
                           Locale.getDefault({@link Locale.Category#DISPLAY}))

</blockquote>

Added in 1.2.

Java documentation for java.util.TimeZone.getDisplayName(boolean, int).

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

GetDisplayName(Boolean, TimeZoneStyle, Locale)

Returns the #SHORT short or #LONG long name of this time zone with either standard or daylight time, as written in locale.

[Android.Runtime.Register("getDisplayName", "(ZILjava/util/Locale;)Ljava/lang/String;", "GetGetDisplayName_ZILjava_util_Locale_Handler")]
public virtual string? GetDisplayName (bool daylightTime, Java.Util.TimeZoneStyle style, Java.Util.Locale? locale);
[<Android.Runtime.Register("getDisplayName", "(ZILjava/util/Locale;)Ljava/lang/String;", "GetGetDisplayName_ZILjava_util_Locale_Handler")>]
abstract member GetDisplayName : bool * Java.Util.TimeZoneStyle * Java.Util.Locale -> string
override this.GetDisplayName : bool * Java.Util.TimeZoneStyle * Java.Util.Locale -> string

Parameters

daylightTime
Boolean

true for daylight time, false for standard time.

style
TimeZoneStyle

either TimeZone#LONG or TimeZone#SHORT.

locale
Locale

the display locale.

Returns

the human-readable name of this time zone in the default locale.

Attributes

Remarks

Returns the #SHORT short or #LONG long name of this time zone with either standard or daylight time, as written in locale. If the name is not available, the result is in the format GMT[+-]hh:mm.

Java documentation for java.util.TimeZone.getDisplayName(boolean, int, java.util.Locale).

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