Replies: 1 comment 5 replies
-
|
An AI tool is faster than asking and waiting for humans in 2025. JavaTimeModule is now built-in so you don't explicitly register it anymore. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The following code is the way to set the serialization format of java8 time in Jackson2. How to migrate to Jackson3
ObjectMapper mapper = new ObjectMapper();
JavaTimeModule module = new JavaTimeModule();
module.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
module.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
mapper.registerModule(module);
Beta Was this translation helpful? Give feedback.
All reactions