Top Description Methods
com.ibm.icu.impl.duration

public Interface DateFormatter

Imports
java.util.Date, .TimeZone

Abstract formatter for dates. Differs from DateFormat in that it provides withLocale and withTimeZone methods.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the formatted time
format
(Date
the date
date
)

Format the date, provided as a java Date object.

public String

Returns:

the formatted time
format
(long
the date in milliseconds
date
)

Format the date, provided as milliseconds.

public DateFormatter

Returns:

a new formatter for the given locale
withLocale
(String
the new locale to use
localeName
)

Returns a new DateFormatter that uses data for a new locale.

public DateFormatter

Returns:

a new formatter for the given time zone
withTimeZone
(TimeZone
the new time zone
tz
)

Returns a new DateFormatter that uses the new time zone.

Method Detail

formatback to summary
public String format(Date date)

Format the date, provided as a java Date object.

Parameters
date:Date

the date

Returns:String

the formatted time

formatback to summary
public String format(long date)

Format the date, provided as milliseconds.

Parameters
date:long

the date in milliseconds

Returns:String

the formatted time

withLocaleback to summary
public DateFormatter withLocale(String localeName)

Returns a new DateFormatter that uses data for a new locale.

Parameters
localeName:String

the new locale to use

Returns:DateFormatter

a new formatter for the given locale

withTimeZoneback to summary
public DateFormatter withTimeZone(TimeZone tz)

Returns a new DateFormatter that uses the new time zone.

Parameters
tz:TimeZone

the new time zone

Returns:DateFormatter

a new formatter for the given time zone