public class DateFormatter extends Object
https://javarevisited.blogspot.com/2013/01/threadlocal-memory-leak-in-java-web.html
https://stackoverflow.com/questions/17968803/threadlocal-memory-leak
DateTimeFormatter is immutable and thread-safe.
DateFormat is not thread-safe.
| Modifier and Type | Field and Description |
|---|---|
static ThreadLocal<DateFormat> |
DATE_FORMAT_19 |
static ThreadLocal<DateFormat> |
DATE_FORMAT_23 |
static DateTimeFormatter |
FMT_DATE_10 |
static DateTimeFormatter |
FMT_FULL_19 |
static DateTimeFormatter |
FMT_FULL_23 |
static DateTimeFormatter |
FMT_TIME_08 |
static DateTimeFormatter |
FMT_TIME_12 |
static String |
PTN_DATE_10 |
static String |
PTN_FULL_19 |
static String |
PTN_FULL_23 |
static String |
PTN_TIME_08 |
static String |
PTN_TIME_12 |
| Modifier and Type | Method and Description |
|---|---|
static @NotNull String |
date10(@Nullable Date date)
格式化成 yyyy-MM-dd 格式,null时返回空支付串
|
static @NotNull String |
date10(@Nullable Date date,
@Nullable ZoneId zoneId)
格式化成 yyyy-MM-dd 格式,null时返回空支付串
|
static @NotNull String |
date10(@Nullable LocalDate date)
格式化成 yyyy-MM-dd 格式,null时返回空支付串
|
static @NotNull String |
date10(@Nullable LocalDateTime date)
格式化成 yyyy-MM-dd 格式,null时返回空支付串
|
static @NotNull String |
date10(@Nullable ZonedDateTime date)
格式化成 yyyy-MM-dd 格式,null时返回空支付串
|
static @NotNull String |
date10(@Nullable ZonedDateTime date,
@Nullable ZoneId zoneId)
格式化成 yyyy-MM-dd 格式,null时返回空支付串
|
static @NotNull String |
fixFull19(@Nullable String date)
保证一致,即相同的字符串,返回结果一致。
修复日期字符串,yyyy-MM-dd HH:mm:ss
`HH`,`MM`,`ss`根据`yyyy-MM-dd`伪随机生成
`yyyy-MM-dd`,分别默认为`1979-01-01`
|
static DateFormat |
full19() |
static @NotNull String |
full19(@Nullable Date date)
格式化成 yyyy-MM-dd HH:mm:ss 格式,null时返回空支付串
|
static @NotNull String |
full19(@Nullable Date date,
@Nullable ZoneId zoneId)
格式化成 yyyy-MM-dd HH:mm:ss 格式,null时返回空支付串
|
static @NotNull String |
full19(@Nullable LocalDateTime date)
格式化成 yyyy-MM-dd HH:mm:ss 格式,null时返回空支付串
|
static @NotNull String |
full19(@Nullable ZonedDateTime date)
格式化成 yyyy-MM-dd HH:mm:ss 格式,null时返回空支付串
|
static @NotNull String |
full19(@Nullable ZonedDateTime date,
@Nullable ZoneId zoneId)
格式化成 yyyy-MM-dd HH:mm:ss 格式,null时返回空支付串
|
static DateFormat |
full23() |
static @NotNull String |
full23(@Nullable Date date)
格式化成 yyyy-MM-dd HH:mm:ss.SSS 格式,null时返回空支付串
|
static @NotNull String |
full23(@Nullable Date date,
@Nullable ZoneId zoneId)
格式化成 yyyy-MM-dd HH:mm:ss.SSS 格式,null时返回空支付串
|
static @NotNull String |
full23(@Nullable LocalDateTime date)
格式化成 yyyy-MM-dd HH:mm:ss.SSS 格式,null时返回空支付串
|
static @NotNull String |
full23(@Nullable ZonedDateTime date)
格式化成 yyyy-MM-dd HH:mm:ss.SSS 格式,null时返回空支付串
|
static @NotNull String |
full23(@Nullable ZonedDateTime date,
@Nullable ZoneId zoneId)
格式化成 yyyy-MM-dd HH:mm:ss.SSS 格式,null时返回空支付串
|
static @NotNull String |
time08(@Nullable Date date)
格式化成 HH:mm:ss 格式,null时返回空支付串
|
static @NotNull String |
time08(@Nullable Date date,
@Nullable ZoneId zoneId)
格式化成 HH:mm:ss 格式,null时返回空支付串
|
static @NotNull String |
time08(@Nullable LocalDateTime date)
格式化成 HH:mm:ss 格式,null时返回空支付串
|
static @NotNull String |
time08(@Nullable LocalTime time)
格式化成 HH:mm:ss 格式,null时返回空支付串
|
static @NotNull String |
time08(@Nullable ZonedDateTime date)
格式化成 HH:mm:ss 格式,null时返回空支付串
|
static @NotNull String |
time08(@Nullable ZonedDateTime date,
@Nullable ZoneId zoneId)
格式化成 HH:mm:ss 格式,null时返回空支付串
|
static @NotNull String |
time12(@Nullable Date date)
格式化成 HH:mm:ss.SSS 格式,null时返回空支付串
|
static @NotNull String |
time12(@Nullable Date date,
@Nullable ZoneId zoneId)
格式化成 HH:mm:ss.SSS 格式,null时返回空支付串
|
static @NotNull String |
time12(@Nullable LocalDateTime date)
格式化成 HH:mm:ss.SSS 格式,null时返回空支付串
|
static @NotNull String |
time12(@Nullable LocalTime time)
格式化成 HH:mm:ss.SSS 格式,null时返回空支付串
|
static @NotNull String |
time12(@Nullable ZonedDateTime date)
格式化成 HH:mm:ss.SSS 格式,null时返回空支付串
|
static @NotNull String |
time12(@Nullable ZonedDateTime date,
@Nullable ZoneId zoneId)
格式化成 HH:mm:ss.SSS 格式,null时返回空支付串
|
static @NotNull ZonedDateTime |
zoned(@NotNull Date date,
@Nullable ZoneId zoneId)
把日期转到相应的时区
|
public static final String PTN_DATE_10
public static final String PTN_TIME_08
public static final String PTN_TIME_12
public static final String PTN_FULL_19
public static final String PTN_FULL_23
public static final DateTimeFormatter FMT_DATE_10
public static final DateTimeFormatter FMT_TIME_08
public static final DateTimeFormatter FMT_TIME_12
public static final DateTimeFormatter FMT_FULL_19
public static final DateTimeFormatter FMT_FULL_23
public static final ThreadLocal<DateFormat> DATE_FORMAT_19
public static final ThreadLocal<DateFormat> DATE_FORMAT_23
public static DateFormat full19()
public static DateFormat full23()
@NotNull public static @NotNull String date10(@Nullable @Nullable ZonedDateTime date)
date - 日期@NotNull public static @NotNull String full19(@Nullable @Nullable ZonedDateTime date)
date - 日期@NotNull public static @NotNull String full23(@Nullable @Nullable ZonedDateTime date)
date - 日期@NotNull public static @NotNull String time08(@Nullable @Nullable ZonedDateTime date)
date - 日期@NotNull public static @NotNull String time12(@Nullable @Nullable ZonedDateTime date)
date - 日期@NotNull public static @NotNull String date10(@Nullable @Nullable ZonedDateTime date, @Nullable @Nullable ZoneId zoneId)
date - 日期zoneId - 时区@NotNull public static @NotNull String full19(@Nullable @Nullable ZonedDateTime date, @Nullable @Nullable ZoneId zoneId)
date - 日期zoneId - 时区@NotNull public static @NotNull String full23(@Nullable @Nullable ZonedDateTime date, @Nullable @Nullable ZoneId zoneId)
date - 日期zoneId - 时区@NotNull public static @NotNull String time08(@Nullable @Nullable ZonedDateTime date, @Nullable @Nullable ZoneId zoneId)
date - 日期zoneId - 时区@NotNull public static @NotNull String time12(@Nullable @Nullable ZonedDateTime date, @Nullable @Nullable ZoneId zoneId)
date - 日期zoneId - 时区@NotNull public static @NotNull String date10(@Nullable @Nullable LocalDateTime date)
date - 日期@NotNull public static @NotNull String full19(@Nullable @Nullable LocalDateTime date)
date - 日期@NotNull public static @NotNull String full23(@Nullable @Nullable LocalDateTime date)
date - 日期@NotNull public static @NotNull String time08(@Nullable @Nullable LocalDateTime date)
date - 日期@NotNull public static @NotNull String time12(@Nullable @Nullable LocalDateTime date)
date - 日期@NotNull public static @NotNull String date10(@Nullable @Nullable LocalDate date)
date - 日期@NotNull public static @NotNull String time08(@Nullable @Nullable LocalTime time)
time - 日期@NotNull public static @NotNull String time12(@Nullable @Nullable LocalTime time)
time - 日期@NotNull public static @NotNull String date10(@Nullable @Nullable Date date)
date - 日期@NotNull public static @NotNull String full19(@Nullable @Nullable Date date)
date - 日期@NotNull public static @NotNull String full23(@Nullable @Nullable Date date)
date - 日期@NotNull public static @NotNull String time08(@Nullable @Nullable Date date)
date - 日期@NotNull public static @NotNull String time12(@Nullable @Nullable Date date)
date - 日期@NotNull public static @NotNull String date10(@Nullable @Nullable Date date, @Nullable @Nullable ZoneId zoneId)
date - 日期zoneId - 时区@NotNull public static @NotNull String full19(@Nullable @Nullable Date date, @Nullable @Nullable ZoneId zoneId)
date - 日期zoneId - 时区@NotNull public static @NotNull String full23(@Nullable @Nullable Date date, @Nullable @Nullable ZoneId zoneId)
date - 日期zoneId - 时区@NotNull public static @NotNull String time08(@Nullable @Nullable Date date, @Nullable @Nullable ZoneId zoneId)
date - 日期zoneId - 时区@NotNull public static @NotNull String time12(@Nullable @Nullable Date date, @Nullable @Nullable ZoneId zoneId)
date - 日期zoneId - 时区@NotNull public static @NotNull ZonedDateTime zoned(@NotNull @NotNull Date date, @Nullable @Nullable ZoneId zoneId)
date - 日期zoneId - 时区Copyright © 2020. All rights reserved.