DatePrinter¶
- public abstract interface org.apache.commons.lang3.time.DatePrinter[source]¶
DatePrinter is the “missing” interface for the format methods of
java.text.DateFormat. You can obtain an object implementing this interface by using one of the FastDateFormat factory methods.Warning: Since binary compatible methods may be added to this interface in any release, developers are not expected to implement this interface.
- Since:
3.2
Methods¶
Formats a |
|
Formats a |
|
Deprecated. Formats a |
|
Formats a |
|
Formats a |
|
Deprecated. Formats a |
|
Formats a millisecond |
|
Formats a millisecond |
|
Deprecated. Formats a millisecond |
|
Gets the locale used by this printer. |
|
Gets the pattern used by this printer. |
|
Gets the time zone used by this printer. |
- public abstract StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)[source]¶
Formats a
Date,CalendarorLong(milliseconds) object.- Parameters:
obj – The object to format.
toAppendTo – The buffer to append to.
pos – The position - ignored.
- Returns:
The buffer passed in.
- See also:
java.text.DateFormat#format(Object, StringBuffer, FieldPosition)
- public abstract String format(Calendar calendar)[source]¶
Formats a
Calendarobject. The TimeZone set on the Calendar is only used to adjust the time offset. The TimeZone specified during the construction of the Parser will determine the TimeZone used in the formatted string.- Parameters:
calendar – The calendar to format.
- Returns:
The formatted string.
- public abstract <B extends Appendable> B format(Calendar calendar, B buf)[source]¶
Formats a
Calendarobject into the suppliedAppendable. The TimeZone set on the Calendar is only used to adjust the time offset. The TimeZone specified during the construction of the Parser will determine the TimeZone used in the formatted string.- Parameters:
calendar – The calendar to format.
buf – The buffer to format into.
- Type parameters:
<B> – The Appendable class type, usually StringBuilder or StringBuffer.
- Returns:
The specified string buffer.
- Since:
3.5
- @Deprecated public abstract StringBuffer format(Calendar calendar, StringBuffer buf)[source]¶
Deprecated: Use {
#format(Calendar, Appendable).Formats a
Calendarobject into the suppliedStringBuffer. The TimeZone set on the Calendar is only used to adjust the time offset. The TimeZone specified during the construction of the Parser will determine the TimeZone used in the formatted string.- Parameters:
calendar – The calendar to format.
buf – The buffer to format into.
- Returns:
The specified string buffer.
- public abstract String format(Date date)[source]¶
Formats a
Dateobject using aGregorianCalendar.- Parameters:
date – The date to format
- Returns:
The formatted string
- public abstract <B extends Appendable> B format(Date date, B buf)[source]¶
Formats a
Dateobject into the suppliedAppendableusing aGregorianCalendar.- Parameters:
date – The date to format.
buf – The buffer to format into.
- Type parameters:
<B> – The Appendable class type, usually StringBuilder or StringBuffer.
- Returns:
The specified string buffer.
- Since:
3.5
- @Deprecated public abstract StringBuffer format(Date date, StringBuffer buf)[source]¶
Deprecated: Use {
#format(Date, Appendable).Formats a
Dateobject into the suppliedStringBufferusing aGregorianCalendar.- Parameters:
date – The date to format.
buf – The buffer to format into.
- Returns:
The specified string buffer.
- public abstract String format(long millis)[source]¶
Formats a millisecond
longvalue.- Parameters:
millis – The millisecond value to format.
- Returns:
The formatted string.
- Since:
2.1
- public abstract <B extends Appendable> B format(long millis, B buf)[source]¶
Formats a millisecond
longvalue into the suppliedAppendable.- Parameters:
millis – The millisecond value to format.
buf – The buffer to format into.
- Type parameters:
<B> – The Appendable class type, usually StringBuilder or StringBuffer.
- Returns:
The specified string buffer.
- Since:
3.5
- @Deprecated public abstract StringBuffer format(long millis, StringBuffer buf)[source]¶
Deprecated: Use {
#format(long, Appendable).Formats a millisecond
longvalue into the suppliedStringBuffer.- Parameters:
millis – The millisecond value to format.
buf – The buffer to format into.
- Returns:
The specified string buffer.
- public abstract Locale getLocale()[source]¶
Gets the locale used by this printer.
- Returns:
The locale.
- public abstract String getPattern()[source]¶
Gets the pattern used by this printer.
- Returns:
The pattern,
java.text.SimpleDateFormatcompatible.