Date format is not respected when serializing map with Date as key
See original GitHub issueWhat steps will reproduce the problem?
1. Crete Map<Date,Object> and populate with random data
2. Create Gson using GsonBuilder and setDateFormat("any format")
3. Serialize map to json.
What is the expected output? What do you see instead?
I expect keys to be serialized using date format, but I see that keys are
converted to strings using Date.toString() which uses generic "EEE MMM dd
HH:mm:ss z yyyy" format
What version of the product are you using? On what operating system?
2.2.4 from Maven,Ubuntu Linux
Original issue reported on code.google.com by mbrzezi...@gmail.com
on 28 Oct 2013 at 5:42
Issue Analytics
- State:
- Created 9 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Date format Mapping to JSON Jackson - java - Stack Overflow
Using this implementation the execution of the serialization and deserialization process consecutively results the origin value. Only using the ...
Read more >The optimal way to include dates in JSON - Dev Genius
JSON format does not have a special type for dates. So dates have to be represented in JSONs as numbers of milliseconds or...
Read more >Jackson Date - Baeldung
In this tutorial, we'll serialize dates with Jackson. We'll start by serializing a simple java.util.Date, then Joda-Time, and finally, the Java ...
Read more >JavaScript JSON Date Parsing and real Dates - Rick Strahl
JavaScript doesn't have a date literal, and for this reason JSON serializes dates as strings rather than real JavaScript dates.
Read more >The Serializer Component (Symfony Docs)
The same way, Normalizers will deal with turning specific objects into arrays and vice versa. Serialization is a complex topic. This component may...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
same issue here - already tried implementing cusom deserializers, but no luck so far. Any chance this gets resolved?
Any Update or Workaround on this issue? Still experiencing this problem in 2.8.0.