You can put @JsonSerialize(using = CustomDateSerializer.class) over any date field of object to be serialized.

public class CustomDateSerializer extends SerializerBase<Date> {

    public CustomDateSerializer() {
        super(Date.class, true);
    }

    @Override
    public void serialize(Date value, JsonGenerator jgen, SerializerProvider provider)
        throws IOException, JsonProcessingException {
        SimpleDateFormat formatter = new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss 'GMT'ZZZ (z)");
        String format = formatter.format(value);
        jgen.writeString(format);
    }

}
Answer from Moesio on Stack Overflow
🌐
Baeldung
baeldung.com › home › json › jackson › jackson – custom serializer
Jackson - Custom Serializer | Baeldung
May 11, 2024 - Item myItem = new Item(1, "theItem", new User(2, "theUser")); ObjectMapper mapper = new ObjectMapper(); SimpleModule module = new SimpleModule(); module.addSerializer(Item.class, new ItemSerializer()); mapper.registerModule(module); String serialized = mapper.writeValueAsString(myItem); That’s it – we now have a simpler, custom JSON serialization of the Item->User entities.
🌐
GitHub
github.com › FasterXML › jackson-docs › wiki › JacksonHowToCustomSerializers
JacksonHowToCustomSerializers · FasterXML/jackson-docs Wiki · GitHub
Jackson 1.7 added ability to register serializers and deserializes via Module interface. This is the recommended way to add custom serializers -- all serializers are considered "generic", in that they are used for subtypes unless more specific binding is found.
Author: FasterXML
🌐
Mkyong
mkyong.com › home › java › jackson custom serializer and deserializer examples
Jackson Custom Serializer and Deserializer Examples | mkyong.com
May 6, 2024 - <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.17.0</version> </dependency> The following example creates a custom serializer to convert the LocalDate type to JSON.
🌐
Medium
medium.com › @AlexanderObregon › writing-custom-jackson-serializers-in-spring-boot-46eae08b003b
Writing Custom Jackson Serializers in Spring Boot | Medium
June 4, 2025 - Maybe you need to format a field ... custom serializers come in. Jackson lets you define exactly how fields or entire objects should be written to JSON by implementing your own serializer logic....
🌐
Spring
docs.spring.io › spring-data › rest › reference › customizing › custom-jackson-deserialization.html
Adding Custom Serializers and Deserializers to Jackson’s ObjectMapper :: Spring Data REST
It tries to serialize unmanaged beans as normal POJOs, and tries to create links to managed beans where necessary. However, if your domain model does not easily lend itself to reading or writing plain JSON, you may want to configure Jackson’s ObjectMapper with your own custom type mappings and (de)serializers.
🌐
DEV Community
dev.to › alaugks › create-a-custom-jackson-jsonserializer-und-jsondeserializer-for-mapping-values-48h7
Create a custom Jackson JsonSerializer und JsonDeserializer for mapping values - DEV Community
March 9, 2025 - For this purpose, I create my own type MappingValue<>. Most importantly, I can transport all types with this custom generics. package com.article.jackson.serializer; public class MappingValue<T> { T value; public MappingValue(T value) { this.value = value; } public T getValue() { return this.value; } }
🌐
HowToDoInJava
howtodoinjava.com › home › jackson › jackson – custom serializer and deserializer
Jackson - Custom Serializer and Deserializer
September 1, 2022 - Learn to create custom Jackson serializers and deserializers, register using the SimpleModule as well as @JsonSerialize and @JsonDeserialize.
Find elsewhere
🌐
ConcretePage
concretepage.com › jackson-api › jackson-custom-serializer
Jackson Custom Serializer
StdSerializer is used for custom ... JsonSerializer. To create a custom serializer, we need to create a class by extending StdSerializer and override serialize method....
🌐
Medium
orashar.medium.com › unlocking-the-power-of-jackson-custom-serializers-and-deserializers-in-kotlinunlocking-the-power-a5325f3ef4b5
Unlocking the Power of Jackson: Custom Serializers and Deserializers in Java/Kotlin | by Om Parashar | Medium
May 16, 2023 - Apply the @JsonSerialize annotation to the desired field or class and provide the custom serializer class using the using attribute. Let’s consider an example where you have a list of tags associated with a blog post.
🌐
LogicBig
logicbig.com › tutorials › misc › jackson › custom-serializer-deserializer.html
Jackson JSON - Registering custom serializer and deserializer
Instead of registering our custom Serializer and Deserializer with ObjectMapper, we can use @JsonSerialize and @JsonDeserialize, check out this example. ... jackson-databind 2.9.5: General data-binding functionality for Jackson: works on core streaming API.
🌐
Baeldung
baeldung.com › home › json › jackson › calling default serializer from custom serializer in jackson
Calling Default Serializer from Custom Serializer in Jackson | Baeldung
January 8, 2024 - Consequently, our SerializerProvider finds the customized serializer every time, instead of the default one, and this causes an infinite loop. So, how do we solve this problem? We’ll see one usable solution for this scenario in the next section. A possible workaround is using BeanSerializerModifier to store the default serializer for the type Folder before Jackson internally overrides it.
🌐
Atomic Spin
spin.atomicobject.com › custom-serializer-jackson
How To Write a Custom Serializer with Jackson - Atomic Spin
September 9, 2016 - However, sometimes more complex translation is necessary and the out-of-the-box features don’t cut it. Fortunately, Jackson provides a way to write custom code and control how any object is translated to JSON. One great use case of a custom serializer is for overriding default behavior.
🌐
TutorialsPoint
tutorialspoint.com › how-to-implement-a-custom-serializer-using-the-jackson-library-in-java
How to implement a custom serializer using the Jackson library in Java?\\n
July 6, 2020 - We can implement a custom serializer using the StdSerializer class and need to override the serialize(T value, JsonGenerator gen, SerializerProvider provider) method, the first argument value represents value to serialize(can not be null), the second argument gen represents generator used to ...
🌐
Google Groups
groups.google.com › g › jackson-user › c › A7MMivlT1dk
Jackson custom serializers
But it is certainly possible to do this via serializers too. Usually I would have looked at `StdDelegatingSerializer`, in which you can take a specific type (that Jackson does not know how to properly serialize), and construct alternative value (like `JsonNode` or `Map`) and let Jackson serialize that instead.
🌐
Davismol
davismol.net › 2015 › 05 › 18 › jackson-create-and-register-a-custom-json-serializer-with-stdserializer-and-simplemodule-classes
Jackson: create and register a custom JSON serializer with StdSerializer and SimpleModule classes | Dede Blog
The goal is to serialize the list ... in square brackets. In Jackson we can do that by performing the following three steps: Create a custom serializer extending the StdSerializer class...
🌐
NEX Softsys
nexsoftsys.com › home › ⚡ articles › spring custom serializers with @jsonidentityinfo
Defining Custom serialization or deserialization using JSON
Jackson library also provides the way to customize the serialization, and also we saw how to inject spring beans into a custom serializer using HandlerInstantiator.
🌐
Medium
medium.com › javarevisited › serializers-de-serializers-in-5-mins-2f8e7d70d516
Custom Serializers/De-serializers in 5 Mins| by Jaideep Pahwa | Javarevisited | Oct, 2022 | Medium | Javarevisited
October 9, 2022 - Spring Boot uses Jackson’s ObjectMapper library to serialize/de-serialize the incoming/outgoing objects. For the object mapper to use our custom implementation we need to register our custom implementation with ObjectMapper.
🌐
Medium
medium.com › @samuelgbenga972 › mastering-custom-serialization-in-java-with-jackson-e240ca00a7c3
🧰 Mastering Custom Serialization in Java with Jackson | by Samuelgbenga | Medium
May 8, 2025 - Back when I started with Java, I used to write whole classes just to turn JSON into Java objects and back. I felt pretty proud — like I had really done something cool. Then I found Jackson’s ObjectMapper, and just one line of code did everything I had worked so hard on.