Share via


DateFormat.Format Method

Definition

Overloads

Format(String, Calendar)

Given a format string and a java.util.Calendar object, returns a CharSequence containing the requested date.

Format(String, Date)

Given a format string and a java.util.Date object, returns a CharSequence containing the requested date.

Format(String, Int64)

Given a format string and a time in milliseconds since Jan 1, 1970 GMT, returns a CharSequence containing the requested date.

Format(String, Calendar)

Given a format string and a java.util.Calendar object, returns a CharSequence containing the requested date.

public static string? Format (string? inFormat, Java.Util.Calendar? inDate);
static member Format : string * Java.Util.Calendar -> string

Parameters

inFormat
String

the format string, as described in android.text.format.DateFormat

inDate
Calendar

the date to format

Returns

a CharSequence containing the requested text

Remarks

Given a format string and a java.util.Calendar object, returns a CharSequence containing the requested date.

Java documentation for android.text.format.DateFormat.format(java.lang.CharSequence, java.util.Calendar).

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(String, Date)

Given a format string and a java.util.Date object, returns a CharSequence containing the requested date.

public static string? Format (string? inFormat, Java.Util.Date? inDate);
static member Format : string * Java.Util.Date -> string

Parameters

inFormat
String

the format string, as described in android.text.format.DateFormat

inDate
Date

the date to format

Returns

a CharSequence containing the requested text

Remarks

Given a format string and a java.util.Date object, returns a CharSequence containing the requested date.

Java documentation for android.text.format.DateFormat.format(java.lang.CharSequence, java.util.Date).

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(String, Int64)

Given a format string and a time in milliseconds since Jan 1, 1970 GMT, returns a CharSequence containing the requested date.

public static string? Format (string? inFormat, long inTimeInMillis);
static member Format : string * int64 -> string

Parameters

inFormat
String

the format string, as described in android.text.format.DateFormat

inTimeInMillis
Int64

in milliseconds since Jan 1, 1970 GMT

Returns

a CharSequence containing the requested text

Remarks

Given a format string and a time in milliseconds since Jan 1, 1970 GMT, returns a CharSequence containing the requested date.

Java documentation for android.text.format.DateFormat.format(java.lang.CharSequence, long).

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