Package com.ibm.icu.impl.duration
Interface DateFormatter
public interface DateFormatter
Abstract formatter for dates. Differs from DateFormat in that it
provides
withLocale
and withTimeZone
methods.-
Method Summary
Modifier and TypeMethodDescriptionformat
(long date) Format the date, provided as milliseconds.Format the date, provided as a java Date object.withLocale
(String localeName) Returns a new DateFormatter that uses data for a new locale.withTimeZone
(TimeZone tz) Returns a new DateFormatter that uses the new time zone.
-
Method Details
-
format
Format the date, provided as a java Date object.- Parameters:
date
- the date- Returns:
- the formatted time
-
format
Format the date, provided as milliseconds.- Parameters:
date
- the date in milliseconds- Returns:
- the formatted time
-
withLocale
Returns a new DateFormatter that uses data for a new locale.- Parameters:
locale
- the new locale to use- Returns:
- a new formatter for the given locale
-
withTimeZone
Returns a new DateFormatter that uses the new time zone.- Parameters:
tz
- the new time zone- Returns:
- a new formatter for the given time zone
-