mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-23 13:03:42 +08:00
!197 update PigJavaTimeModule.java.
Merge pull request !197 from Hacker/N/A
This commit is contained in:
commit
1c104ec5b1
@ -47,8 +47,7 @@ public class PigJavaTimeModule extends SimpleModule {
|
|||||||
|
|
||||||
// ======================= 时间序列化规则 ===============================
|
// ======================= 时间序列化规则 ===============================
|
||||||
// yyyy-MM-dd HH:mm:ss
|
// yyyy-MM-dd HH:mm:ss
|
||||||
this.addSerializer(LocalDateTime.class,
|
this.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DatePattern.NORM_TIME_FORMATTER));
|
||||||
new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
|
||||||
// yyyy-MM-dd
|
// yyyy-MM-dd
|
||||||
this.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ISO_LOCAL_DATE));
|
this.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ISO_LOCAL_DATE));
|
||||||
// HH:mm:ss
|
// HH:mm:ss
|
||||||
@ -58,8 +57,7 @@ public class PigJavaTimeModule extends SimpleModule {
|
|||||||
|
|
||||||
// ======================= 时间反序列化规则 ==============================
|
// ======================= 时间反序列化规则 ==============================
|
||||||
// yyyy-MM-dd HH:mm:ss
|
// yyyy-MM-dd HH:mm:ss
|
||||||
this.addDeserializer(LocalDateTime.class,
|
this.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DatePattern.NORM_TIME_FORMATTER));
|
||||||
new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
|
||||||
// yyyy-MM-dd
|
// yyyy-MM-dd
|
||||||
this.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ISO_LOCAL_DATE));
|
this.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ISO_LOCAL_DATE));
|
||||||
// HH:mm:ss
|
// HH:mm:ss
|
||||||
|
Loading…
Reference in New Issue
Block a user