public class JavaUtilDateFormat extends DateFormat
java.util.Date, none zone offset.
unix timestamp只支持对10位(秒)和13位(毫秒)做解析
线程安全
DateFormat.Field| 限定符和类型 | 字段和说明 |
|---|---|
static JavaUtilDateFormat |
DEFAULT
The default date format with yyyy-MM-dd HH:mm:ss
|
AM_PM_FIELD, calendar, DATE_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_WEEK_IN_MONTH_FIELD, DAY_OF_YEAR_FIELD, ERA_FIELD, FULL, HOUR_OF_DAY0_FIELD, HOUR_OF_DAY1_FIELD, HOUR0_FIELD, HOUR1_FIELD, LONG, MEDIUM, MILLISECOND_FIELD, MINUTE_FIELD, MONTH_FIELD, numberFormat, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD| 构造器和说明 |
|---|
JavaUtilDateFormat(org.apache.commons.lang3.time.FastDateFormat format) |
JavaUtilDateFormat(String pattern) |
JavaUtilDateFormat(String pattern,
Locale locale) |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
clone() |
boolean |
equals(Object obj) |
StringBuffer |
format(Date date,
StringBuffer toAppendTo,
FieldPosition fieldPosition) |
AttributedCharacterIterator |
formatToCharacterIterator(Object obj) |
int |
hashCode() |
Date |
parse(String source) |
Date |
parse(String source,
ParsePosition pos) |
Object |
parseObject(String source) |
Object |
parseObject(String source,
ParsePosition pos) |
LocalDateTime |
parseToLocalDateTime(String source) |
LocalDateTime |
parseToLocalDateTime(String source,
ParsePosition pos) |
void |
setCalendar(Calendar newCalendar)
已过时。
|
void |
setLenient(boolean lenient)
已过时。
|
void |
setNumberFormat(NumberFormat newNumberFormat)
已过时。
|
void |
setTimeZone(TimeZone zone)
已过时。
|
public static final JavaUtilDateFormat DEFAULT
public JavaUtilDateFormat(String pattern)
public JavaUtilDateFormat(org.apache.commons.lang3.time.FastDateFormat format)
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition)
format 在类中 DateFormatpublic Date parse(String source, ParsePosition pos)
parse 在类中 DateFormatpublic Date parse(String source) throws ParseException
parse 在类中 DateFormatParseExceptionpublic LocalDateTime parseToLocalDateTime(String source) throws ParseException
ParseExceptionpublic LocalDateTime parseToLocalDateTime(String source, ParsePosition pos)
public Object parseObject(String source, ParsePosition pos)
parseObject 在类中 DateFormatpublic Object parseObject(String source) throws ParseException
parseObject 在类中 FormatParseExceptionpublic int hashCode()
hashCode 在类中 DateFormatpublic boolean equals(Object obj)
equals 在类中 DateFormatpublic AttributedCharacterIterator formatToCharacterIterator(Object obj)
formatToCharacterIterator 在类中 Formatpublic Object clone()
clone 在类中 DateFormat@Deprecated public void setCalendar(Calendar newCalendar)
setCalendar 在类中 DateFormat@Deprecated public void setNumberFormat(NumberFormat newNumberFormat)
setNumberFormat 在类中 DateFormat@Deprecated public void setTimeZone(TimeZone zone)
setTimeZone 在类中 DateFormat@Deprecated public void setLenient(boolean lenient)
setLenient 在类中 DateFormatCopyright © 2023. All rights reserved.