/** * Returns the time formatter with the given formatting style * for the given locale. * @param style the given 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. * @param locale the given ulocale. * @return a time formatter. * @stable ICU 3.2 */ public final static DateFormat getTimeInstance(int style, ULocale locale) { return get(-1, style, locale, null); }
/** * Returns the date formatter with the given formatting style * for the given locale. * @param style 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 <field type="day">/<relative> data: For example, * in English, "Yesterday", "Today", and "Tomorrow". Outside of this range, relative * dates are formatted using the corresponding non-relative style. * @param locale the given ulocale. * @return a date formatter. * @stable ICU 3.2 */ public final static DateFormat getDateInstance(int style, ULocale locale) { return get(style, -1, locale, null); }
/** * Returns the date/time formatter with the given formatting styles * for the given locale. * @param dateStyle 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 <field type="day">/<relative> data: For example, * in English, "Yesterday", "Today", and "Tomorrow". Outside of this range, relative * dates are formatted using the corresponding non-relative style. * @param timeStyle the given time formatting style. Relative time styles are not * currently supported, and behave just like the corresponding non-relative style. * @param locale the given ulocale. * @return a date/time formatter. * @stable ICU 3.2 */ public final static DateFormat getDateTimeInstance( int dateStyle, int timeStyle, ULocale locale) { return get(dateStyle, timeStyle, locale, null); }
/** * Gets the time formatter with the default formatting style * for the default <code>FORMAT</code> locale. * @return a time formatter. * @see Category#FORMAT * @stable ICU 2.0 */ public final static DateFormat getTimeInstance() { return get(-1, DEFAULT, ULocale.getDefault(Category.FORMAT), null); }
/** * Creates a {@link DateFormat} object that can be used to format dates and times in * the calendar system specified by <code>cal</code>. * @param cal The calendar system for which a date/time format is desired. * * @param dateStyle The type of date format desired. This can be * {@link DateFormat#SHORT}, {@link DateFormat#MEDIUM}, * etc. * * @param timeStyle The type of time format desired. This can be * {@link DateFormat#SHORT}, {@link DateFormat#MEDIUM}, * etc. * * @param locale The locale for which the date/time format is desired. * * @see DateFormat#getDateTimeInstance * @stable ICU 3.2 */ static final public DateFormat getDateTimeInstance(Calendar cal, int dateStyle, int timeStyle, ULocale locale) { if (cal == null) { throw new IllegalArgumentException("Calendar must be supplied"); } return get(dateStyle, timeStyle, locale, cal); }
/** * Returns the date formatter with the default formatting style * for the default <code>FORMAT</code> locale. * @return a date formatter. * @see Category#FORMAT * @stable ICU 2.0 */ public final static DateFormat getDateInstance() { return get(DEFAULT, -1, ULocale.getDefault(Category.FORMAT), null); }
/** * Returns the date/time formatter with the default formatting style * for the default <code>FORMAT</code> locale. * @return a date/time formatter. * @see Category#FORMAT * @stable ICU 2.0 */ public final static DateFormat getDateTimeInstance() { return get(DEFAULT, DEFAULT, ULocale.getDefault(Category.FORMAT), null); }
/** * Returns the time formatter with the given formatting style * for the default <code>FORMAT</code> locale. * @param style the given 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. * @return a time formatter. * @see Category#FORMAT * @stable ICU 2.0 */ public final static DateFormat getTimeInstance(int style) { return get(-1, style, ULocale.getDefault(Category.FORMAT), null); }
/** * Returns the time formatter with the given formatting style * for the given locale. * @param style the given 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. * @param aLocale the given locale. * @return a time formatter. * @stable ICU 2.0 */ public final static DateFormat getTimeInstance(int style, Locale aLocale) { return get(-1, style, ULocale.forLocale(aLocale), null); }
/** * Returns the date formatter with the given formatting style * for the default <code>FORMAT</code> locale. * @param style 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 <field type="day">/<relative> data: For example, * in English, "Yesterday", "Today", and "Tomorrow". Outside of this range, relative * dates are formatted using the corresponding non-relative style. * @return a date formatter. * @see Category#FORMAT * @stable ICU 2.0 */ public final static DateFormat getDateInstance(int style) { return get(style, -1, ULocale.getDefault(Category.FORMAT), null); }
/** * Returns the date formatter with the given formatting style * for the given locale. * @param style 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 <field type="day">/<relative> data: For example, * in English, "Yesterday", "Today", and "Tomorrow". Outside of this range, relative * dates are formatted using the corresponding non-relative style. * @param aLocale the given locale. * @return a date formatter. * @stable ICU 2.0 */ public final static DateFormat getDateInstance(int style, Locale aLocale) { return get(style, -1, ULocale.forLocale(aLocale), null); }
/** * Returns the date/time formatter with the given formatting styles * for the given locale. * @param dateStyle 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 <field type="day">/<relative> data: For example, * in English, "Yesterday", "Today", and "Tomorrow". Outside of this range, relative * dates are formatted using the corresponding non-relative style. * @param timeStyle the given time formatting style. Relative time styles are not * currently supported, and behave just like the corresponding non-relative style. * @param aLocale the given locale. * @return a date/time formatter. * @stable ICU 2.0 */ public final static DateFormat getDateTimeInstance( int dateStyle, int timeStyle, Locale aLocale) { return get(dateStyle, timeStyle, ULocale.forLocale(aLocale), null); }
/** * Returns the date/time formatter with the given date and time * formatting styles for the default <code>FORMAT</code> locale. * @param dateStyle 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 <field type="day">/<relative> data: For example, * in English, "Yesterday", "Today", and "Tomorrow". Outside of this range, relative * dates are formatted using the corresponding non-relative style. * @param timeStyle 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. * @return a date/time formatter. * @see Category#FORMAT * @stable ICU 2.0 */ public final static DateFormat getDateTimeInstance(int dateStyle, int timeStyle) { return get(dateStyle, timeStyle, ULocale.getDefault(Category.FORMAT), null); }