Interface FormatPrinter
- All Superinterfaces:
DatePrinter
- All Known Implementing Classes:
FastDatePrinter,FormatBuilder
日期格式化输出接口
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Method Summary
Modifier and TypeMethodDescriptionformat(long millis) 格式化日期表示的毫秒数<B extends Appendable>
Bformat(long millis, B buf) Formats a millisecondlongvalue into the suppliedAppendable.Formats aCalendarobject.<B extends Appendable>
BFormats aCalendarobject into the suppliedAppendable.使用GregorianCalendar格式化Date<B extends Appendable>
BFormats aDateobject into the suppliedAppendableusing aGregorianCalendar.Methods inherited from interface org.miaixz.bus.core.center.date.printer.DatePrinter
getLocale, getPattern, getTimeZone
-
Method Details
-
format
格式化日期表示的毫秒数- Parameters:
millis- 日期毫秒数- Returns:
- the formatted string
-
format
使用GregorianCalendar格式化Date- Parameters:
date- 日期Date- Returns:
- 格式化后的字符串
-
format
Formats aCalendarobject.格式化
Calendar- Parameters:
calendar-Calendar- Returns:
- 格式化后的字符串
-
format
Formats a millisecondlongvalue 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
-
format
Formats aDateobject into the suppliedAppendableusing 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
-
format
Formats 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 formatbuf- the buffer to format into- Returns:
- the specified string buffer
-