Interface DatePrinter
- All Known Implementing Classes:
FastDateFormat
,FastDatePrinter
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 Summary
Modifier and TypeMethodDescriptionformat
(long millis) Formats a millisecondlong
value.<B extends Appendable>
Bformat
(long millis, B buf) Formats a millisecondlong
value into the suppliedAppendable
.format
(long millis, StringBuffer buf) Deprecated.format
(Object obj, StringBuffer toAppendTo, FieldPosition pos) Formats aDate
,Calendar
orLong
(milliseconds) object.Formats aCalendar
object.<B extends Appendable>
BFormats aCalendar
object into the suppliedAppendable
.format
(Calendar calendar, StringBuffer buf) Deprecated.Formats aDate
object using aGregorianCalendar
.<B extends Appendable>
BFormats aDate
object into the suppliedAppendable
using aGregorianCalendar
.format
(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
-
format
Formats a millisecond
long
value.- Parameters:
millis
- the millisecond value to format- Returns:
- the formatted string
- Since:
- 2.1
-
format
Formats a
Date
object using aGregorianCalendar
.- Parameters:
date
- the date to format- Returns:
- the formatted string
-
format
Formats a
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.Calendar
object.- Parameters:
calendar
- the calendar to format.- Returns:
- the formatted string
-
format
Deprecated.Use {format(long, Appendable)
.Formats a millisecond
long
value into the suppliedStringBuffer
.- Parameters:
millis
- the millisecond value to formatbuf
- the buffer to format into- Returns:
- the specified string buffer
-
format
Deprecated.Use {format(Date, Appendable)
.Formats a
Date
object into the suppliedStringBuffer
using aGregorianCalendar
.- Parameters:
date
- the date to formatbuf
- the buffer to format into- Returns:
- the specified string buffer
-
format
Deprecated.Formats a
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.Calendar
object into the suppliedStringBuffer
.- Parameters:
calendar
- the calendar to formatbuf
- the buffer to format into- Returns:
- the specified string buffer
-
format
Formats a millisecond
long
value into the suppliedAppendable
.- Type Parameters:
B
- the Appendable class type, usually StringBuilder or StringBuffer.- Parameters:
millis
- the millisecond value to formatbuf
- the buffer to format into- Returns:
- the specified string buffer
- Since:
- 3.5
-
format
Formats a
Date
object into the suppliedAppendable
using aGregorianCalendar
.- Type Parameters:
B
- the Appendable class type, usually StringBuilder or StringBuffer.- Parameters:
date
- the date to formatbuf
- the buffer to format into- Returns:
- the specified string buffer
- Since:
- 3.5
-
format
Formats a
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.Calendar
object into the suppliedAppendable
.- Type Parameters:
B
- the Appendable class type, usually StringBuilder or StringBuffer.- Parameters:
calendar
- the calendar to formatbuf
- the buffer to format into- Returns:
- the specified string buffer
- Since:
- 3.5
-
getPattern
String getPattern()Gets the pattern used by this printer.
- Returns:
- the pattern,
SimpleDateFormat
compatible
-
getTimeZone
TimeZone getTimeZone()Gets the time zone used by this printer.
This zone is always used for
Date
printing.- Returns:
- the time zone
-
getLocale
Locale getLocale()Gets the locale used by this printer.
- Returns:
- the locale
-
format
Formats a
Date
,Calendar
orLong
(milliseconds) object.- Parameters:
obj
- the object to formattoAppendTo
- the buffer to append topos
- the position - ignored- Returns:
- the buffer passed in
- See Also:
-
format(long, Appendable)
.