/** * {@icu} Returns a {@link DateFormat} object that can be used to format dates and times in * the default locale. * The getInstanceForSkeleton methods are preferred over the getPatternInstance methods. * * @param skeleton The skeleton that selects the fields to be formatted. (Uses the * {@link DateTimePatternGenerator}.) This can be {@link DateFormat#ABBR_MONTH}, * {@link DateFormat#MONTH_WEEKDAY_DAY}, etc. * * @stable ICU 4.0 */ public final static DateFormat getPatternInstance(String skeleton) { return getInstanceForSkeleton(skeleton); }
/** * {@icu} Returns a {@link DateFormat} object that can be used to format dates and times in * the given locale. * The getInstanceForSkeleton methods are preferred over the getPatternInstance methods. * * @param skeleton The skeleton that selects the fields to be formatted. (Uses the * {@link DateTimePatternGenerator}.) This can be {@link DateFormat#ABBR_MONTH}, * {@link DateFormat#MONTH_WEEKDAY_DAY}, etc. * * @param locale The locale for which the date/time format is desired. * * @stable ICU 4.0 */ public final static DateFormat getPatternInstance(String skeleton, Locale locale) { return getInstanceForSkeleton(skeleton, locale); }
/** * {@icu} Returns a {@link DateFormat} object that can be used to format dates and times in * the given locale. * The getInstanceForSkeleton methods are preferred over the getPatternInstance methods. * * @param skeleton The skeleton that selects the fields to be formatted. (Uses the * {@link DateTimePatternGenerator}.) This can be {@link DateFormat#ABBR_MONTH}, * {@link DateFormat#MONTH_WEEKDAY_DAY}, etc. * * @param locale The locale for which the date/time format is desired. * * @stable ICU 4.0 */ public final static DateFormat getPatternInstance(String skeleton, ULocale locale) { return getInstanceForSkeleton(skeleton, locale); }
/** * {@icu} Creates a {@link DateFormat} object that can be used to format dates and * times in the calendar system specified by <code>cal</code>. * The getInstanceForSkeleton methods are preferred over the getPatternInstance methods. * * @param cal The calendar system for which a date/time format is desired. * * @param skeleton The skeleton that selects the fields to be formatted. (Uses the * {@link DateTimePatternGenerator}.) This can be * {@link DateFormat#ABBR_MONTH}, {@link DateFormat#MONTH_WEEKDAY_DAY}, * etc. * * @param locale The locale for which the date/time format is desired. * * @stable ICU 4.0 */ public final static DateFormat getPatternInstance( Calendar cal, String skeleton, ULocale locale) { return getInstanceForSkeleton(cal, skeleton, locale); }
/** * {@icu} Creates a {@link DateFormat} object that can be used to format dates and * times in the calendar system specified by <code>cal</code>. * The getInstanceForSkeleton methods are preferred over the getPatternInstance methods. * * @param cal The calendar system for which a date/time format is desired. * * @param skeleton The skeleton that selects the fields to be formatted. (Uses the * {@link DateTimePatternGenerator}.) This can be * {@link DateFormat#ABBR_MONTH}, {@link DateFormat#MONTH_WEEKDAY_DAY}, * etc. * * @param locale The locale for which the date/time format is desired. * * @stable ICU 4.0 */ public final static DateFormat getPatternInstance(Calendar cal, String skeleton, Locale locale) { return getInstanceForSkeleton(cal, skeleton, locale); }
DateFormat format = DateFormat.getInstanceForSkeleton(skeleton, locale); format.setTimeZone(TimeZone.getTimeZone(timeZoneId)); return format.format(new Date(timeMillis));