Partager via


SimpleDateFormat.Format(Calendar, StringBuffer, FieldPosition) Method

Definition

Formats a date or time, which is the standard millis since January 1, 1970, 00:00:00 GMT.

[Android.Runtime.Register("format", "(Landroid/icu/util/Calendar;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Landroid_icu_util_Calendar_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)]
public override Java.Lang.StringBuffer? Format (Android.Icu.Util.Calendar? cal, Java.Lang.StringBuffer? toAppendTo, Java.Text.FieldPosition? pos);
[<Android.Runtime.Register("format", "(Landroid/icu/util/Calendar;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Landroid_icu_util_Calendar_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)>]
override this.Format : Android.Icu.Util.Calendar * Java.Lang.StringBuffer * Java.Text.FieldPosition -> Java.Lang.StringBuffer

Parameters

cal
Calendar

the calendar whose date-time value is to be formatted into a date-time string

toAppendTo
StringBuffer

where the new date-time text is to be appended

pos
FieldPosition

the formatting position. On input: an alignment field, if desired. On output: the offsets of the alignment field.

Returns

the formatted date-time string.

Attributes

Remarks

Formats a date or time, which is the standard millis since January 1, 1970, 00:00:00 GMT.

Example: using the US locale: "yyyy.MM.dd G 'at' HH:mm:ss zzz" -&gt;&gt; 1996.07.10 AD at 15:08:56 PDT

Java documentation for android.icu.text.SimpleDateFormat.format(android.icu.util.Calendar, 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