StdDateFormat: add option to serialize timezone offset with a colon
See original GitHub issueJackson’s StdDateFormat serializes datetimes without colon in the timezone offset, eg. 1970-01-01T01:00:00.123+0100
.
Java8 and Joda have decided to include a colon in the offset, eg 1970-01-01T01:00:00.123+01:00
.
Although Joda accepts to deserialize a datetime with or without the colon, Java8 considers the colon as mandatory and fails to deserialize datetimes produced Jackson’s StdDateFormat.
In addition, some platforms like iOS also require a colon in the offset and are therefore also unable to read dates produces by Jackson’s StdDateFormat.
Consequence: It would be nice if Jackson’s StdDateFormat could be easily configured, extended or customized to include a colon in the timezone offset.
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (10 by maintainers)
Top Results From Across the Web
StdDateFormat (jackson-databind 2.11.0 API) - FasterXML
Accessor for checking whether this instance would include colon within timezone serialization or not: if {code true}, timezone offset is serialized like -06:00 ......
Read more >java - Jackson OffsetDateTime serialization Z instead of +00 ...
Is there something I'm missing or doing wrong here, or anyway I can get the timezone information serialized as the +00:00 format instead...
Read more >Jackson Data Binding Source Code - JAR
Inclusion of colon as separator, as default setting, started in Jackson 2.11: ... timezone offset * is serialized like {@code -06:00}; if {code...
Read more >com.fasterxml.jackson.databind.util.StdDateFormat.<init> java ...
"Mutant factory" method that will return an instance that has specified * handling of colon when serializing timezone (timezone either written * like...
Read more >lamsfoundation-lams-39bc85b / - 3rdParty_sources / - jackson
public StdDateFormat withTimeZone(TimeZone tz) { if (tz == null) { tz ... that has specified * handling of colon when serializing timezone (timezone...
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
spring.jackson.date-format=yyyy-MM-dd'T'HH:mm:ss.SSSXXX
The triple X means to use colon per SimpleDateFormat docs from Oracle. https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html?is-external=true@caeaugusto no problem; and I am sorry to hear in a way it is JDK issue… since it is not something we can easily address at this point. But if you or anyone else finds workarounds, links to documentation, maybe even reported bugs in oracle’s bug tracker, those would be good additions here.