DateTimePatternGenerator.DateTimeFormat Property

Definition

Getter corresponding to setDateTimeFormat. -or- The date time format is a message format pattern used to compose date and time patterns.

public virtual string? DateTimeFormat { [Android.Runtime.Register("getDateTimeFormat", "()Ljava/lang/String;", "GetGetDateTimeFormatHandler", ApiSince=24)] get; [Android.Runtime.Register("setDateTimeFormat", "(Ljava/lang/String;)V", "GetSetDateTimeFormat_Ljava_lang_String_Handler", ApiSince=24)] set; }
[<get: Android.Runtime.Register("getDateTimeFormat", "()Ljava/lang/String;", "GetGetDateTimeFormatHandler", ApiSince=24)>]
[<set: Android.Runtime.Register("setDateTimeFormat", "(Ljava/lang/String;)V", "GetSetDateTimeFormat_Ljava_lang_String_Handler", ApiSince=24)>]
member this.DateTimeFormat : string with get, set

Property Value

pattern

Attributes

Remarks

Property getter documentation:

Getter corresponding to setDateTimeFormat.

There are four DateTimeFormats in a DateTimePatternGenerator object, corresponding to date styles DateFormat.FULL..DateFormat.SHORT. This method gets the style for DateFormat.MEDIUM (the default). To get them individually, see getDateTimeFormat(int style).

Java documentation for android.icu.text.DateTimePatternGenerator.getDateTimeFormat().

Property setter documentation:

The date time format is a message format pattern used to compose date and time patterns. The default value is "{1}{0}", where {1} will be replaced by the date pattern and {0} will be replaced by the time pattern.

This is used when the input skeleton contains both date and time fields, but there is not a close match among the added patterns. For example, suppose that this object was created by adding "dd-MMM" and "hh:mm", and its datetimeFormat is the default "{1}{0}". Then if the input skeleton is "MMMdhmm", there is not an exact match, so the input skeleton is broken up into two components "MMMd" and "hmm". There are close matches for those two skeletons, so the result is put together with this pattern, resulting in "d-MMM h:mm".

There are four DateTimeFormats in a DateTimePatternGenerator object, corresponding to date styles DateFormat.FULL..DateFormat.SHORT. This method sets all of them to the specified pattern. To set them individually, see setDateTimeFormat(int style, ...).

Java documentation for android.icu.text.DateTimePatternGenerator.setDateTimeFormat(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