다음을 통해 공유


DateTimePatternGenerator.SetDateTimeFormat(Int32, String) Method

Definition

dateTimeFormats are message patterns used to compose combinations of date and time patterns.

[Android.Runtime.Register("setDateTimeFormat", "(ILjava/lang/String;)V", "GetSetDateTimeFormat_ILjava_lang_String_Handler", ApiSince=35)]
public virtual void SetDateTimeFormat (int style, string? dateTimeFormat);
[<Android.Runtime.Register("setDateTimeFormat", "(ILjava/lang/String;)V", "GetSetDateTimeFormat_ILjava_lang_String_Handler", ApiSince=35)>]
abstract member SetDateTimeFormat : int * string -> unit
override this.SetDateTimeFormat : int * string -> unit

Parameters

style
Int32

one of DateFormat.FULL..DateFormat.SHORT. An exception will be thrown if out of range.

dateTimeFormat
String

the new dateTimeFormat to set for the specified style

Attributes

Remarks

dateTimeFormats are message patterns used to compose combinations of date and time patterns. There are four length styles, corresponding to the inferred style of the date pattern: - DateFormat.FULL (for date pattern with weekday and long month), else - DateFormat.LONG (for a date pattern with long month), else - DateFormat.MEDIUM (for a date pattern with abbreviated month), else - DateFormat.SHORT (for any other date pattern). For details on dateTimeFormats, see https://www.unicode.org/reports/tr35/tr35-dates.html#dateTimeFormats. The default pattern in the root locale for all styles is "{1}{0}".

Java documentation for android.icu.text.DateTimePatternGenerator.setDateTimeFormat(int, java.lang.String).

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