Sdílet prostřednictvím


DateFormat.GetDateTimeInstance Method

Definition

Overloads

GetDateTimeInstance(DateFormatStyle, Int32)

Returns the date/time formatter with the given date and time formatting styles for the default FORMAT locale.

GetDateTimeInstance(DateFormatStyle, Int32, ULocale)

Returns the date/time formatter with the given formatting styles for the given locale.

GetDateTimeInstance(DateFormatStyle, Int32, Locale)

Returns the date/time formatter with the given formatting styles for the given locale.

GetDateTimeInstance(Calendar, DateFormatStyle, Int32)

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

GetDateTimeInstance(Calendar, DateFormatStyle, Int32, ULocale)

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

GetDateTimeInstance(Calendar, DateFormatStyle, Int32, Locale)

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

GetDateTimeInstance(DateFormatStyle, Int32)

Returns the date/time formatter with the given date and time formatting styles for the default FORMAT locale.

[Android.Runtime.Register("getDateTimeInstance", "(II)Landroid/icu/text/DateFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateFormat? GetDateTimeInstance (Android.Icu.Text.DateFormatStyle dateStyle, int timeStyle);
[<Android.Runtime.Register("getDateTimeInstance", "(II)Landroid/icu/text/DateFormat;", "", ApiSince=24)>]
static member GetDateTimeInstance : Android.Icu.Text.DateFormatStyle * int -> Android.Icu.Text.DateFormat

Parameters

dateStyle
DateFormatStyle

the given date 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.

timeStyle
Int32

the given time formatting style. For example, SHORT for "h:mm a" in the US locale. Relative time styles are not currently supported, and behave just like the corresponding non-relative style.

Returns

a date/time formatter.

Attributes

Remarks

Returns the date/time formatter with the given date and time formatting styles for the default FORMAT locale.

Java documentation for android.icu.text.DateFormat.getDateTimeInstance(int, 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

GetDateTimeInstance(DateFormatStyle, Int32, ULocale)

Returns the date/time formatter with the given formatting styles for the given locale.

[Android.Runtime.Register("getDateTimeInstance", "(IILandroid/icu/util/ULocale;)Landroid/icu/text/DateFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateFormat? GetDateTimeInstance (Android.Icu.Text.DateFormatStyle dateStyle, int timeStyle, Android.Icu.Util.ULocale? locale);
[<Android.Runtime.Register("getDateTimeInstance", "(IILandroid/icu/util/ULocale;)Landroid/icu/text/DateFormat;", "", ApiSince=24)>]
static member GetDateTimeInstance : Android.Icu.Text.DateFormatStyle * int * Android.Icu.Util.ULocale -> Android.Icu.Text.DateFormat

Parameters

dateStyle
DateFormatStyle

the given date formatting style. 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.

timeStyle
Int32

the given time formatting style. Relative time styles are not currently supported, and behave just like the corresponding non-relative style.

locale
ULocale

the given ulocale.

Returns

a date/time formatter.

Attributes

Remarks

Returns the date/time formatter with the given formatting styles for the given locale.

Java documentation for android.icu.text.DateFormat.getDateTimeInstance(int, 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

GetDateTimeInstance(DateFormatStyle, Int32, Locale)

Returns the date/time formatter with the given formatting styles for the given locale.

[Android.Runtime.Register("getDateTimeInstance", "(IILjava/util/Locale;)Landroid/icu/text/DateFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateFormat? GetDateTimeInstance (Android.Icu.Text.DateFormatStyle dateStyle, int timeStyle, Java.Util.Locale? aLocale);
[<Android.Runtime.Register("getDateTimeInstance", "(IILjava/util/Locale;)Landroid/icu/text/DateFormat;", "", ApiSince=24)>]
static member GetDateTimeInstance : Android.Icu.Text.DateFormatStyle * int * Java.Util.Locale -> Android.Icu.Text.DateFormat

Parameters

dateStyle
DateFormatStyle

the given date formatting style. 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.

timeStyle
Int32

the given time formatting style. Relative time styles are not currently supported, and behave just like the corresponding non-relative style.

aLocale
Locale

the given locale.

Returns

a date/time formatter.

Attributes

Remarks

Returns the date/time formatter with the given formatting styles for the given locale.

Java documentation for android.icu.text.DateFormat.getDateTimeInstance(int, 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

GetDateTimeInstance(Calendar, DateFormatStyle, Int32)

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

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

Parameters

cal
Calendar

The calendar system for which a date/time format is desired.

dateStyle
DateFormatStyle

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

timeStyle
Int32

The type of time 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 and times in the calendar system specified by cal.

Java documentation for android.icu.text.DateFormat.getDateTimeInstance(android.icu.util.Calendar, int, 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

GetDateTimeInstance(Calendar, DateFormatStyle, Int32, ULocale)

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

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

Parameters

cal
Calendar

The calendar system for which a date/time format is desired.

dateStyle
DateFormatStyle

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

timeStyle
Int32

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

locale
ULocale

The locale for which the date/time format is desired.

Returns

Attributes

Remarks

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

Java documentation for android.icu.text.DateFormat.getDateTimeInstance(android.icu.util.Calendar, int, 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

GetDateTimeInstance(Calendar, DateFormatStyle, Int32, Locale)

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

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

Parameters

cal
Calendar

The calendar system for which a date/time format is desired.

dateStyle
DateFormatStyle

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

timeStyle
Int32

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

locale
Locale

The locale for which the date/time format is desired.

Returns

Attributes

Remarks

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

Java documentation for android.icu.text.DateFormat.getDateTimeInstance(android.icu.util.Calendar, int, 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