!197 update PigJavaTimeModule.java.

Merge pull request !197 from Hacker/N/A
This commit is contained in:
lbw 2022-03-10 03:12:35 +00:00 committed by Gitee
commit 1c104ec5b1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -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