Share via


DateTimeFormatter.ToFormat Method

Definition

Overloads

ToFormat()

Returns this formatter as a java.text.Format instance.

ToFormat(ITemporalQuery)

Returns this formatter as a java.text.Format instance that will parse using the specified query.

ToFormat()

Returns this formatter as a java.text.Format instance.

[Android.Runtime.Register("toFormat", "()Ljava/text/Format;", "", ApiSince=26)]
public Java.Text._Format? ToFormat ();
[<Android.Runtime.Register("toFormat", "()Ljava/text/Format;", "", ApiSince=26)>]
member this.ToFormat : unit -> Java.Text._Format

Returns

this formatter as a classic format instance, not null

Attributes

Remarks

Returns this formatter as a java.text.Format instance.

The returned Format instance will format any TemporalAccessor and parses to a resolved TemporalAccessor.

Exceptions will follow the definitions of Format, see those methods for details about IllegalArgumentException during formatting and ParseException or null during parsing. The format does not support attributing of the returned format string.

Java documentation for java.time.format.DateTimeFormatter.toFormat().

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

ToFormat(ITemporalQuery)

Returns this formatter as a java.text.Format instance that will parse using the specified query.

[Android.Runtime.Register("toFormat", "(Ljava/time/temporal/TemporalQuery;)Ljava/text/Format;", "", ApiSince=26)]
public Java.Text._Format? ToFormat (Java.Time.Temporal.ITemporalQuery? parseQuery);
[<Android.Runtime.Register("toFormat", "(Ljava/time/temporal/TemporalQuery;)Ljava/text/Format;", "", ApiSince=26)>]
member this.ToFormat : Java.Time.Temporal.ITemporalQuery -> Java.Text._Format

Parameters

parseQuery
ITemporalQuery

the query defining the type to parse to, not null

Returns

this formatter as a classic format instance, not null

Attributes

Remarks

Returns this formatter as a java.text.Format instance that will parse using the specified query.

The returned Format instance will format any TemporalAccessor and parses to the type specified. The type must be one that is supported by #parse.

Exceptions will follow the definitions of Format, see those methods for details about IllegalArgumentException during formatting and ParseException or null during parsing. The format does not support attributing of the returned format string.

Java documentation for java.time.format.DateTimeFormatter.toFormat(java.time.temporal.TemporalQuery<?>).

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