public class YMDDateFormatter extends Object implements DateFormatter
| Constructor and Description |
|---|
YMDDateFormatter(String requestedFields)
Creates a new formatter that formats the requested
fields.
|
YMDDateFormatter(String requestedFields,
String localeName,
TimeZone timeZone)
Creates a new formatter that formats the requested
fields using the provided locale and time zone.
|
| Modifier and Type | Method and Description |
|---|---|
String |
format(Date date)
Returns a string representing the formatted date.
|
String |
format(long date)
Returns a string representing the formatted date.
|
DateFormatter |
withLocale(String locName)
Returns a version of this formatter customized to the provided locale.
|
DateFormatter |
withTimeZone(TimeZone tz)
Returns a version of this formatter customized to the provided time zone.
|
public YMDDateFormatter(String requestedFields)
requestedFields - the requested fieldspublic YMDDateFormatter(String requestedFields, String localeName, TimeZone timeZone)
requestedFields - the requested fieldslocaleName - the locale to usetimeZone - the time zone to usepublic String format(long date)
format in interface DateFormatterdate - the date in millisecondspublic String format(Date date)
format in interface DateFormatterdate - the datepublic DateFormatter withLocale(String locName)
withLocale in interface DateFormatterpublic DateFormatter withTimeZone(TimeZone tz)
withTimeZone in interface DateFormattertz - the new time zone