Returns a new
DateFormat
instance which formats date and time
with the given formatting style for the specified locale.
Returns:
a date/time formatter.
Parameters:
-
dateStyle - the given date formatting style. Either one of
{@link java.text.DateFormat#SHORT DateFormat.SHORT},
{@link java.text.DateFormat#MEDIUM DateFormat.MEDIUM},
{@link java.text.DateFormat#LONG DateFormat.LONG}, or
{@link java.text.DateFormat#FULL DateFormat.FULL}.
-
timeStyle - the given time formatting style. Either one of
{@link java.text.DateFormat#SHORT DateFormat.SHORT},
{@link java.text.DateFormat#MEDIUM DateFormat.MEDIUM},
{@link java.text.DateFormat#LONG DateFormat.LONG}, or
{@link java.text.DateFormat#FULL DateFormat.FULL}.
-
locale - the desired locale.
Throws:
-
IllegalArgumentException - if
dateStyle
or
timeStyle
is invalid,
or if
locale
isn't
one of the locales returned from
{@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
getAvailableLocales()}.
-
NullPointerException - if
locale
is null
See Also:
DateFormat.getDateTimeInstance(int, int, java.util.Locale)
,