Package org.apache.commons.lang3.time
Interface DatePrinter
- All Known Implementing Classes:
- FastDateFormat,- FastDatePrinter
public interface DatePrinter
DatePrinter is the "missing" interface for the format methods of
 
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
- 
Method SummaryModifier and TypeMethodDescriptionformat(long millis) Formats a millisecondlongvalue.<B extends Appendable>
 Bformat(long millis, B buf) Formats a millisecondlongvalue into the suppliedAppendable.format(long millis, StringBuffer buf) Deprecated.format(Object obj, StringBuffer toAppendTo, FieldPosition pos) Formats aCalendarobject.<B extends Appendable>
 BFormats aCalendarobject into the suppliedAppendable.format(Calendar calendar, StringBuffer buf) Deprecated.Formats aDateobject using aGregorianCalendar.<B extends Appendable>
 Bformat(Date date, StringBuffer buf) Deprecated.Use {format(Date, Appendable).Gets the locale used by this printer.Gets the pattern used by this printer.Gets the time zone used by this printer.
- 
Method Details- 
formatFormats aCalendarobject. 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
 
- 
formatFormats aCalendarobject 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.- Type Parameters:
- B- the Appendable class type, usually StringBuilder or StringBuffer.
- Parameters:
- calendar- the calendar to format
- buf- the buffer to format into
- Returns:
- the specified string buffer
- Since:
- 3.5
 
- 
formatDeprecated.Formats aCalendarobject 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
 
- 
formatFormats aDateobject using aGregorianCalendar.- Parameters:
- date- the date to format
- Returns:
- the formatted string
 
- 
format- Type Parameters:
- B- the Appendable class type, usually StringBuilder or StringBuffer.
- Parameters:
- date- the date to format
- buf- the buffer to format into
- Returns:
- the specified string buffer
- Since:
- 3.5
 
- 
formatDeprecated.Use {format(Date, Appendable).- Parameters:
- date- the date to format
- buf- the buffer to format into
- Returns:
- the specified string buffer
 
- 
formatFormats a millisecondlongvalue.- Parameters:
- millis- the millisecond value to format
- Returns:
- the formatted string
- Since:
- 2.1
 
- 
formatFormats a millisecondlongvalue into the suppliedAppendable.- Type Parameters:
- B- the Appendable class type, usually StringBuilder or StringBuffer.
- Parameters:
- millis- the millisecond value to format
- buf- the buffer to format into
- Returns:
- the specified string buffer
- Since:
- 3.5
 
- 
formatDeprecated.Use {format(long, Appendable).Formats a millisecondlongvalue into the suppliedStringBuffer.- Parameters:
- millis- the millisecond value to format
- buf- the buffer to format into
- Returns:
- the specified string buffer
 
- 
format- Parameters:
- obj- the object to format
- toAppendTo- the buffer to append to
- pos- the position - ignored
- Returns:
- the buffer passed in
- See Also:
 
- 
getLocaleGets the locale used by this printer.- Returns:
- the locale
 
- 
getPatternGets the pattern used by this printer.- Returns:
- the pattern, SimpleDateFormatcompatible
 
- 
getTimeZoneGets the time zone used by this printer.This zone is always used for Dateprinting.- Returns:
- the time zone
 
 
- 
format(long, Appendable).