Język

TimeZoneFormat.Format Method

Definition

Overloads

Name Description
Format(Object, StringBuffer, FieldPosition)

Formats an object and appends the resulting text to a given string buffer.

Format(TimeZoneFormat+Style, TimeZone, Int64)

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

Format(TimeZoneFormat+Style, TimeZone, Int64, Output)

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

Format(Object, StringBuffer, FieldPosition)

Formats an object and appends the resulting text to a given string buffer.

[Android.Runtime.Register("format", "(Ljava/lang/Object;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Ljava_lang_Object_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)]
public override Java.Lang.StringBuffer? Format(Java.Lang.Object? obj, Java.Lang.StringBuffer? toAppendTo, Java.Text.FieldPosition? pos);
[<Android.Runtime.Register("format", "(Ljava/lang/Object;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Ljava_lang_Object_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)>]
override this.Format : Java.Lang.Object * Java.Lang.StringBuffer * Java.Text.FieldPosition -> Java.Lang.StringBuffer

Parameters

obj
Object

The object to format

toAppendTo
StringBuffer

where the text is to be appended

pos
FieldPosition

A FieldPosition identifying a field in the formatted text

Returns

the string buffer passed in as toAppendTo, with formatted text appended

Attributes

Remarks

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.

Java documentation for android.icu.text.TimeZoneFormat.format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition).

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

Format(TimeZoneFormat+Style, TimeZone, Int64)

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

[Android.Runtime.Register("format", "(Landroid/icu/text/TimeZoneFormat$Style;Landroid/icu/util/TimeZone;J)Ljava/lang/String;", "", ApiSince=24)]
public string? Format(Android.Icu.Text.TimeZoneFormat.Style? style, Android.Icu.Util.TimeZone? tz, long date);
[<Android.Runtime.Register("format", "(Landroid/icu/text/TimeZoneFormat$Style;Landroid/icu/util/TimeZone;J)Ljava/lang/String;", "", ApiSince=24)>]
override this.Format : Android.Icu.Text.TimeZoneFormat.Style * Android.Icu.Util.TimeZone * int64 -> string

Parameters

style
TimeZoneFormat.Style

the style enum (e.g. GENERIC_LONG, LOCALIZED_GMT...)

tz
TimeZone

the time zone.

date
Int64

the date.

Returns

the display name of the time zone.

Attributes

Remarks

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 for the details.

Android reference for android.icu.text.TimeZoneFormat.format.

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

Format(TimeZoneFormat+Style, TimeZone, Int64, Output)

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

[Android.Runtime.Register("format", "(Landroid/icu/text/TimeZoneFormat$Style;Landroid/icu/util/TimeZone;JLandroid/icu/util/Output;)Ljava/lang/String;", "GetFormat_Landroid_icu_text_TimeZoneFormat_Style_Landroid_icu_util_TimeZone_JLandroid_icu_util_Output_Handler", ApiSince=24)]
public virtual string? Format(Android.Icu.Text.TimeZoneFormat.Style? style, Android.Icu.Util.TimeZone? tz, long date, Android.Icu.Util.Output? timeType);
[<Android.Runtime.Register("format", "(Landroid/icu/text/TimeZoneFormat$Style;Landroid/icu/util/TimeZone;JLandroid/icu/util/Output;)Ljava/lang/String;", "GetFormat_Landroid_icu_text_TimeZoneFormat_Style_Landroid_icu_util_TimeZone_JLandroid_icu_util_Output_Handler", ApiSince=24)>]
override this.Format : Android.Icu.Text.TimeZoneFormat.Style * Android.Icu.Util.TimeZone * int64 * Android.Icu.Util.Output -> string

Parameters

style
TimeZoneFormat.Style

the style enum (e.g. GENERIC_LONG, LOCALIZED_GMT...)

tz
TimeZone

the time zone.

date
Int64

the date.

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.

Returns

the display name of the time zone.

Attributes

Remarks

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 format(Style,TimeZone,long). The argument is used for receiving the time type (standard time or daylight saving time, or unknown) actually used for the display name.

Android reference for android.icu.text.TimeZoneFormat.format.

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