ISO8601DateFormat is deprecated but replacement is unclear.
See original GitHub issuecom.fasterxml.jackson.databind.util.ISO8601DateFormat
is deprecated since 2.9 but I couldn’t find any information about how to replace its current usage while upgrading.
So far, I checked the following locations:
- the release notes.
- the related blog entry.
- the related issue.
- StackOverflow
But no luck…
I suspect that I could probably just delete objectMapper.setDateFormat(new ISO8601DateFormat());
and be fine but I wanted to double-check.
So this is a bug report against the documentation, not the code. If it can be safely removed and dates are still serialized as ISO-8601 strings then this should be mentioned somewhere.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:11 (6 by maintainers)
Top Results From Across the Web
replacing ISO8601Utils with the external json schema ...
There was a question on GitHub: ISO8601DateFormat is deprecated but replacement is unclear related to your question.
Read more >ISO8601DateFormat (jackson-databind 2.9.0 API) - FasterXML
@Deprecated public class ISO8601DateFormat extends DateFormat ... All other methods but parse and format and clone are undefined behavior.
Read more >Why isn't DATE_ISO8601 deprecated? : r/PHP - Reddit
I feel like a date format named ISO8601 that is not compatible with the ISO-8601 standard is a very confusing thing.
Read more >ISO Date format with Biblatex/Biber? - LaTeX Stack Exchange
Now edtf has been replaced by iso . ... As of biblatex 3.5, iso8601 is deprecated and edtf together with seconds=true should be...
Read more >ISO 8601 - Wikipedia
In these representations, the [n] is replaced by the value for each of the date and time elements that follow the [n]. Leading...
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 Free
Top 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
Looks like default
StdDateFormat
doesn’t format date-time the same asISO8601DateFormat
.I found this while integrating with a 3rd party API which uses Swagger spec. In Swagger they have a
date-time
data type:According to the RFC the timezone information must follow this BNF:
Notice the
":"
intime-numoffset
is not optional, but defaultStdDateFormat
is omitting it, so Swagger implementations will refuse such dates.Not sure if that’s an issue in RFC or Swagger, but I cannot really use the default
StdDateFormat
. WithISO8601DateFormat
everything works as expected, but as I understand the class is deprecated for removal.For posterity, here’s an example of serializing to iso8601 without the ISO8601DateFormat class from the jackson tests themselves: https://github.com/FasterXML/jackson-databind/blob/b1aa8e300519076b2140a2bfd73bf0eac73191de/src/test/java/com/fasterxml/jackson/databind/ser/jdk/DateSerializationTest.java#L118