Share via


DateFormat.GetDateInstance Method

Definition

Overloads

GetDateInstance(Calendar, DateFormatStyle, ULocale)

Creates a DateFormat object that can be used to format dates in the calendar system specified by cal.

GetDateInstance(Calendar, DateFormatStyle, Locale)

Creates a DateFormat object that can be used to format dates in the calendar system specified by cal.

GetDateInstance(Calendar, DateFormatStyle)

Creates a DateFormat object for the default locale that can be used to format dates in the calendar system specified by cal.

GetDateInstance(DateFormatStyle)

Returns the date formatter with the given formatting style for the default FORMAT locale.

GetDateInstance(DateFormatStyle, ULocale)

Returns the date formatter with the given formatting style for the given locale.

GetDateInstance(DateFormatStyle, Locale)

Returns the date formatter with the given formatting style for the given locale.

GetDateInstance(Calendar, DateFormatStyle, ULocale)

Creates a DateFormat object that can be used to format dates in the calendar system specified by cal.

[Android.Runtime.Register("getDateInstance", "(Landroid/icu/util/Calendar;ILandroid/icu/util/ULocale;)Landroid/icu/text/DateFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateFormat? GetDateInstance (Android.Icu.Util.Calendar? cal, Android.Icu.Text.DateFormatStyle dateStyle, Android.Icu.Util.ULocale? locale);
[<Android.Runtime.Register("getDateInstance", "(Landroid/icu/util/Calendar;ILandroid/icu/util/ULocale;)Landroid/icu/text/DateFormat;", "", ApiSince=24)>]
static member GetDateInstance : Android.Icu.Util.Calendar * Android.Icu.Text.DateFormatStyle * Android.Icu.Util.ULocale -> Android.Icu.Text.DateFormat

Parameters

cal
Calendar

The calendar system for which a date format is desired.

dateStyle
DateFormatStyle

The type of date format desired. This can be DateFormat#SHORT, DateFormat#MEDIUM, etc.

locale
ULocale

The locale for which the date format is desired.

Returns

Attributes

Remarks

Creates a DateFormat object that can be used to format dates in the calendar system specified by cal.

Java documentation for android.icu.text.DateFormat.getDateInstance(android.icu.util.Calendar, int, android.icu.util.ULocale).

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

GetDateInstance(Calendar, DateFormatStyle, Locale)

Creates a DateFormat object that can be used to format dates in the calendar system specified by cal.

[Android.Runtime.Register("getDateInstance", "(Landroid/icu/util/Calendar;ILjava/util/Locale;)Landroid/icu/text/DateFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateFormat? GetDateInstance (Android.Icu.Util.Calendar? cal, Android.Icu.Text.DateFormatStyle dateStyle, Java.Util.Locale? locale);
[<Android.Runtime.Register("getDateInstance", "(Landroid/icu/util/Calendar;ILjava/util/Locale;)Landroid/icu/text/DateFormat;", "", ApiSince=24)>]
static member GetDateInstance : Android.Icu.Util.Calendar * Android.Icu.Text.DateFormatStyle * Java.Util.Locale -> Android.Icu.Text.DateFormat

Parameters

cal
Calendar

The calendar system for which a date format is desired.

dateStyle
DateFormatStyle

The type of date format desired. This can be DateFormat#SHORT, DateFormat#MEDIUM, etc.

locale
Locale

The locale for which the date format is desired.

Returns

Attributes

Remarks

Creates a DateFormat object that can be used to format dates in the calendar system specified by cal.

Java documentation for android.icu.text.DateFormat.getDateInstance(android.icu.util.Calendar, int, java.util.Locale).

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

GetDateInstance(Calendar, DateFormatStyle)

Creates a DateFormat object for the default locale that can be used to format dates in the calendar system specified by cal.

[Android.Runtime.Register("getDateInstance", "(Landroid/icu/util/Calendar;I)Landroid/icu/text/DateFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateFormat? GetDateInstance (Android.Icu.Util.Calendar? cal, Android.Icu.Text.DateFormatStyle dateStyle);
[<Android.Runtime.Register("getDateInstance", "(Landroid/icu/util/Calendar;I)Landroid/icu/text/DateFormat;", "", ApiSince=24)>]
static member GetDateInstance : Android.Icu.Util.Calendar * Android.Icu.Text.DateFormatStyle -> Android.Icu.Text.DateFormat

Parameters

cal
Calendar

The calendar system for which a date format is desired.

dateStyle
DateFormatStyle

The type of date format desired. This can be DateFormat#SHORT, DateFormat#MEDIUM, etc.

Returns

Attributes

Remarks

Creates a DateFormat object for the default locale that can be used to format dates in the calendar system specified by cal.

Java documentation for android.icu.text.DateFormat.getDateInstance(android.icu.util.Calendar, int).

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

GetDateInstance(DateFormatStyle)

Returns the date formatter with the given formatting style for the default FORMAT locale.

[Android.Runtime.Register("getDateInstance", "(I)Landroid/icu/text/DateFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateFormat? GetDateInstance (Android.Icu.Text.DateFormatStyle style);
[<Android.Runtime.Register("getDateInstance", "(I)Landroid/icu/text/DateFormat;", "", ApiSince=24)>]
static member GetDateInstance : Android.Icu.Text.DateFormatStyle -> Android.Icu.Text.DateFormat

Parameters

style
DateFormatStyle

the given formatting style. For example, SHORT for "M/d/yy" in the US locale. As currently implemented, relative date formatting only affects a limited range of calendar days before or after the current date, based on the CLDR &lt;field type="day"&gt;/&lt;relative&gt; data: For example, in English, "Yesterday", "Today", and "Tomorrow". Outside of this range, relative dates are formatted using the corresponding non-relative style.

Returns

a date formatter.

Attributes

Remarks

Returns the date formatter with the given formatting style for the default FORMAT locale.

Java documentation for android.icu.text.DateFormat.getDateInstance(int).

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

GetDateInstance(DateFormatStyle, ULocale)

Returns the date formatter with the given formatting style for the given locale.

[Android.Runtime.Register("getDateInstance", "(ILandroid/icu/util/ULocale;)Landroid/icu/text/DateFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateFormat? GetDateInstance (Android.Icu.Text.DateFormatStyle style, Android.Icu.Util.ULocale? locale);
[<Android.Runtime.Register("getDateInstance", "(ILandroid/icu/util/ULocale;)Landroid/icu/text/DateFormat;", "", ApiSince=24)>]
static member GetDateInstance : Android.Icu.Text.DateFormatStyle * Android.Icu.Util.ULocale -> Android.Icu.Text.DateFormat

Parameters

style
DateFormatStyle

the given formatting style. For example, SHORT for "M/d/yy" in the US locale. As currently implemented, relative date formatting only affects a limited range of calendar days before or after the current date, based on the CLDR &lt;field type="day"&gt;/&lt;relative&gt; data: For example, in English, "Yesterday", "Today", and "Tomorrow". Outside of this range, relative dates are formatted using the corresponding non-relative style.

locale
ULocale

the given ulocale.

Returns

a date formatter.

Attributes

Remarks

Returns the date formatter with the given formatting style for the given locale.

Java documentation for android.icu.text.DateFormat.getDateInstance(int, android.icu.util.ULocale).

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

GetDateInstance(DateFormatStyle, Locale)

Returns the date formatter with the given formatting style for the given locale.

[Android.Runtime.Register("getDateInstance", "(ILjava/util/Locale;)Landroid/icu/text/DateFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateFormat? GetDateInstance (Android.Icu.Text.DateFormatStyle style, Java.Util.Locale? aLocale);
[<Android.Runtime.Register("getDateInstance", "(ILjava/util/Locale;)Landroid/icu/text/DateFormat;", "", ApiSince=24)>]
static member GetDateInstance : Android.Icu.Text.DateFormatStyle * Java.Util.Locale -> Android.Icu.Text.DateFormat

Parameters

style
DateFormatStyle

the given formatting style. For example, SHORT for "M/d/yy" in the US locale. As currently implemented, relative date formatting only affects a limited range of calendar days before or after the current date, based on the CLDR &lt;field type="day"&gt;/&lt;relative&gt; data: For example, in English, "Yesterday", "Today", and "Tomorrow". Outside of this range, relative dates are formatted using the corresponding non-relative style.

aLocale
Locale

the given locale.

Returns

a date formatter.

Attributes

Remarks

Returns the date formatter with the given formatting style for the given locale.

Java documentation for android.icu.text.DateFormat.getDateInstance(int, java.util.Locale).

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