Package com.ibm.icu.impl.duration
Interface DateFormatter
-
- All Known Implementing Classes:
YMDDateFormatter
public interface DateFormatterAbstract formatter for dates. Differs from DateFormat in that it provideswithLocaleandwithTimeZonemethods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringformat(long date)Format the date, provided as milliseconds.Stringformat(Date date)Format the date, provided as a java Date object.DateFormatterwithLocale(String localeName)Returns a new DateFormatter that uses data for a new locale.DateFormatterwithTimeZone(TimeZone tz)Returns a new DateFormatter that uses the new time zone.
-
-
-
Method Detail
-
format
String format(Date date)
Format the date, provided as a java Date object.- Parameters:
date- the date- Returns:
- the formatted time
-
format
String format(long date)
Format the date, provided as milliseconds.- Parameters:
date- the date in milliseconds- Returns:
- the formatted time
-
withLocale
DateFormatter withLocale(String localeName)
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
DateFormatter withTimeZone(TimeZone tz)
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
-
-