question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`StdDateFormat` deserializes dates with no tz/offset as UTC instead of configured timezone

See original GitHub issue

Prior to version 2.8.9, dates without time zone or time offset (eg 1970-01-01T00:00:00.000) were deserialised in the TimeZone set on the ObjectMapper. Starting from 2.8.9, these dates are deserialised in UTC - which is a major (breaking) change in behaviour…

Example:

ObjectMapper mapper = new ObjectMapper();
mapper.setTimeZone(TimeZone.getTimeZone("GMT+2");
Date date = mapper.readValue("\"1970-01-01T00:00:00.000\"", java.util.Date.class);

// date == "1970-01-01T00:00:00.000+02.00" with Jackson < 2.8.9
// date == "1970-01-01T00:00:00.000+00.00" with Jackson  2.8.9

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
brenuartcommented, Jun 27, 2017

@cowtowncoder Any chance we could release 2.8.9.1 soon ?

0reactions
cowtowncodercommented, Jun 27, 2017

@brenuart I could do that relatively soon – I am hoping for a fix or two, for some reason getting lots of reports now. Could do one before leaving for vacation on saturday.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`StdDateFormat` deserializes dates with no tz/offset as UTC ...
9 , dates without time zone or time offset (eg 1970-01-01T00:00:00.000 ) were deserialised in the TimeZone set on the ObjectMapper. Starting ...
Read more >
StdDateFormat (jackson-databind 2.13.0 API) - FasterXML
Method used for creating a new instance with specified timezone; if no timezone specified, defaults to the default timezone (UTC). Methods inherited from...
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 >
Class StdDateFormat
Method used for creating a new instance with specified timezone; if no timezone specified, defaults to the default timezone (UTC).
Read more >
DateTimeZoneHandling setting - Json.NET
Flight flight = new Flight { Destination = "Dubai", DepartureDate = new DateTime(2013, 1, 21, 0, 0, 0, DateTimeKind.Unspecified), DepartureDateUtc = new ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found