TimeZoneFormat.Format 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Format(Object, StringBuffer, FieldPosition) |
格式化物件並將產生的文字附加到指定的字串緩衝區。 |
| Format(TimeZoneFormat+Style, TimeZone, Int64) |
回傳該樣式指定日期的時區顯示名稱。 |
| Format(TimeZoneFormat+Style, TimeZone, Int64, Output) |
回傳該樣式指定日期的時區顯示名稱。 |
Format(Object, StringBuffer, FieldPosition)
格式化物件並將產生的文字附加到指定的字串緩衝區。
[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
參數
- obj
- Object
格式化物件
- toAppendTo
- StringBuffer
其中文字需附加
- pos
- FieldPosition
欄位位置 識別格式化文字中的欄位
傳回
字串緩衝區以 toAppendTo 形式傳送,並附有格式化文字
- 屬性
備註
格式化物件並將產生的文字附加到指定的字串緩衝區。 如果 pos 參數識別格式所使用的欄位,則其索引會設為第一個遇到的欄位的開始與結束。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
Format(TimeZoneFormat+Style, TimeZone, Int64)
回傳該樣式指定日期的時區顯示名稱。
[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
參數
- style
- TimeZoneFormat.Style
樣式列舉(例如 GENERIC_LONG、LOCALIZED_GMT...)
- tz
- TimeZone
時區。
- date
- Int64
日期。
傳回
顯示時區名稱。
- 屬性
備註
回傳該樣式指定日期的時區顯示名稱。 注意:風格可能有備用風格。 例如,當請求GENERIC_LONG但沒有GENERIC_LONG樣式的顯示名稱資料時,實作可能會使用 GENERIC_LOCATION 或 LOCALIZED_GMT。 詳情請參閱 UTS#35 UNICODE LOCALE DATA MARKUP LANGUAGE(LDML)附錄 J:時區顯示名稱。
Android 參考資料。android.icu.text.TimeZoneFormat.format
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
Format(TimeZoneFormat+Style, TimeZone, Int64, Output)
回傳該樣式指定日期的時區顯示名稱。
[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
參數
- style
- TimeZoneFormat.Style
樣式列舉(例如 GENERIC_LONG、LOCALIZED_GMT...)
- tz
- TimeZone
時區。
- date
- Int64
日期。
- timeType
- Output
輸出參數用於接收顯示名稱所用的時間類型(標準/日光/未知),若非必要資訊則指定為空。
傳回
顯示時區名稱。
- 屬性
備註
回傳該樣式指定日期的時區顯示名稱。 此方法除了格式(Style, TimeZone, long)的參數列表外,還會額外使用一個參數 Output<TimeType> , timeType。 參數用於接收顯示名稱實際使用的時間類型(標準時間、夏令時間或未知時間)。
Android 參考資料。android.icu.text.TimeZoneFormat.format
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。