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 |
---|---|
java.lang.String |
format(java.util.Calendar calendar)
Formats a
Calendar object. |
<B extends java.lang.Appendable> |
format(java.util.Calendar calendar,
B buf)
Formats a
Calendar object into the supplied Appendable . |
java.lang.StringBuffer |
format(java.util.Calendar calendar,
java.lang.StringBuffer buf)
Deprecated.
|
java.lang.String |
format(java.util.Date date)
Formats a
Date object using a GregorianCalendar . |
<B extends java.lang.Appendable> |
format(java.util.Date date,
B buf)
Formats a
Date object into the
supplied Appendable using a GregorianCalendar . |
java.lang.StringBuffer |
format(java.util.Date date,
java.lang.StringBuffer buf)
Deprecated.
Use {
format(Date, Appendable) . |
java.lang.String |
format(long millis)
Formats a millisecond
long value. |
<B extends java.lang.Appendable> |
format(long millis,
B buf)
Formats a millisecond
long value into the
supplied Appendable . |
java.lang.StringBuffer |
format(long millis,
java.lang.StringBuffer buf)
Deprecated.
Use {
format(long, Appendable) . |
java.lang.StringBuffer |
format(java.lang.Object obj,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition pos)
Formats a
Date , Calendar or
Long (milliseconds) object. |
java.util.Locale |
getLocale()
Gets the locale used by this printer.
|
java.lang.String |
getPattern()
Gets the pattern used by this printer.
|
java.util.TimeZone |
getTimeZone()
Gets the time zone used by this printer.
|
java.lang.String format(long millis)
long
value.millis
- the millisecond value to formatjava.lang.String format(java.util.Date date)
Date
object using a GregorianCalendar
.date
- the date to formatjava.lang.String format(java.util.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.@Deprecated java.lang.StringBuffer format(long millis, java.lang.StringBuffer buf)
format(long, Appendable)
.long
value into the
supplied StringBuffer
.millis
- the millisecond value to formatbuf
- the buffer to format into@Deprecated java.lang.StringBuffer format(java.util.Date date, java.lang.StringBuffer buf)
format(Date, Appendable)
.Date
object into the
supplied StringBuffer
using a GregorianCalendar
.date
- the date to formatbuf
- the buffer to format into@Deprecated java.lang.StringBuffer format(java.util.Calendar calendar, java.lang.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 into<B extends java.lang.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<B extends java.lang.Appendable> B format(java.util.Date date, B buf)
Date
object into the
supplied Appendable
using a GregorianCalendar
.B
- the Appendable class type, usually StringBuilder or StringBuffer.date
- the date to formatbuf
- the buffer to format into<B extends java.lang.Appendable> B format(java.util.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 intojava.lang.String getPattern()
SimpleDateFormat
compatiblejava.util.TimeZone getTimeZone()
This zone is always used for Date
printing.
java.util.Locale getLocale()
java.lang.StringBuffer format(java.lang.Object obj, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
Date
, Calendar
or
Long
(milliseconds) object.obj
- the object to formattoAppendTo
- the buffer to append topos
- the position - ignoredDateFormat.format(Object, StringBuffer, FieldPosition)
Copyright © 2010 - 2023 Adobe. All Rights Reserved