public interface DatePrinter
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.
Modifier and Type | Method and Description |
---|---|
String |
format(Calendar calendar)
Formats a
Calendar object. |
<B extends Appendable> |
format(Calendar calendar,
B buf)
Formats a
Calendar object into the supplied Appendable . |
StringBuffer |
format(Calendar calendar,
StringBuffer buf)
Deprecated.
|
String |
format(Date date)
Formats a
Date object using a GregorianCalendar . |
<B extends Appendable> |
format(Date date,
B buf)
|
StringBuffer |
format(Date date,
StringBuffer buf)
Deprecated.
Use {
format(Date, Appendable) . |
String |
format(long millis)
Formats a millisecond
long value. |
<B extends Appendable> |
format(long millis,
B buf)
Formats a millisecond
long value into the
supplied Appendable . |
StringBuffer |
format(long millis,
StringBuffer buf)
Deprecated.
Use {
format(long, Appendable) . |
StringBuffer |
format(Object obj,
StringBuffer toAppendTo,
FieldPosition pos)
|
Locale |
getLocale()
Gets the locale used by this printer.
|
String |
getPattern()
Gets the pattern used by this printer.
|
TimeZone |
getTimeZone()
Gets the time zone used by this printer.
|
String format(Calendar calendar)
Calendar
object.
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
- the calendar to format.<B extends Appendable> B format(Calendar calendar, B buf)
Calendar
object into the supplied Appendable
.
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.B
- the Appendable class type, usually StringBuilder or StringBuffer.calendar
- the calendar to formatbuf
- the buffer to format into@Deprecated StringBuffer format(Calendar calendar, StringBuffer buf)
format(Calendar, Appendable)
.Calendar
object into the supplied StringBuffer
.
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
- the calendar to formatbuf
- the buffer to format intoString format(Date date)
Date
object using a GregorianCalendar
.date
- the date to format<B extends Appendable> B format(Date date, B buf)
B
- the Appendable class type, usually StringBuilder or StringBuffer.date
- the date to formatbuf
- the buffer to format into@Deprecated StringBuffer format(Date date, StringBuffer buf)
format(Date, Appendable)
.date
- the date to formatbuf
- the buffer to format intoString format(long millis)
long
value.millis
- the millisecond value to format<B extends Appendable> B format(long millis, B buf)
long
value into the
supplied Appendable
.B
- the Appendable class type, usually StringBuilder or StringBuffer.millis
- the millisecond value to formatbuf
- the buffer to format into@Deprecated StringBuffer format(long millis, StringBuffer buf)
format(long, Appendable)
.long
value into the
supplied StringBuffer
.millis
- the millisecond value to formatbuf
- the buffer to format intoStringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
obj
- the object to formattoAppendTo
- the buffer to append topos
- the position - ignoredDateFormat.format(Object, StringBuffer, FieldPosition)
String getPattern()
SimpleDateFormat
compatibleTimeZone getTimeZone()
This zone is always used for Date
printing.
Copyright © 2001–2023 The Apache Software Foundation. All rights reserved.