Partager via


DateIntervalFormat.Format Method

Definition

Overloads

Format(DateInterval, StringBuffer, FieldPosition)

Format a DateInterval to produce a string.

Format(Object, StringBuffer, FieldPosition)

Format an object to produce a string.

Format(Calendar, Calendar, StringBuffer, FieldPosition)

Format 2 Calendars to produce a string.

Format(DateInterval, StringBuffer, FieldPosition)

Format a DateInterval to produce a string.

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

Parameters

dtInterval
DateInterval

DateInterval to be formatted.

appendTo
StringBuffer

Output parameter to receive result. Result is appended to existing contents.

fieldPosition
FieldPosition

On input: an alignment field, if desired. On output: the offsets of the alignment field. There may be multiple instances of a given field type in an interval format; in this case the fieldPosition offsets refer to the first instance.

Returns

Reference to 'appendTo' parameter.

Attributes

Remarks

Format a DateInterval to produce a string.

Java documentation for android.icu.text.DateIntervalFormat.format(android.icu.util.DateInterval, 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(Object, StringBuffer, FieldPosition)

Format an object to produce a string.

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

Parameters

obj
Object

The object to format. Must be a DateInterval.

appendTo
StringBuffer

Output parameter to receive result. Result is appended to existing contents.

fieldPosition
FieldPosition

On input: an alignment field, if desired. On output: the offsets of the alignment field. There may be multiple instances of a given field type in an interval format; in this case the fieldPosition offsets refer to the first instance.

Returns

Reference to 'appendTo' parameter.

Attributes

Remarks

Format an object to produce a string. This method handles Formattable objects with a DateInterval type. If a the Formattable object type is not a DateInterval, IllegalArgumentException is thrown.

Java documentation for android.icu.text.DateIntervalFormat.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(Calendar, Calendar, StringBuffer, FieldPosition)

Format 2 Calendars to produce a string.

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

Parameters

fromCalendar
Calendar

calendar set to the from date in date interval to be formatted into date interval string

toCalendar
Calendar

calendar set to the to date in date interval to be formatted into date interval string

appendTo
StringBuffer

Output parameter to receive result. Result is appended to existing contents.

pos
FieldPosition

On input: an alignment field, if desired. On output: the offsets of the alignment field. There may be multiple instances of a given field type in an interval format; in this case the fieldPosition offsets refer to the first instance.

Returns

Reference to 'appendTo' parameter.

Attributes

Remarks

Format 2 Calendars to produce a string.

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