-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StdDateFormat
fails to parse 'zulu' date when TimeZone other than UTC
#1651
Comments
And tested against version... ? Yes, from test handling does look incorrect. |
Tested with master (~2.9.0.pr3) and test fails. |
Issue detected with |
@brenuart Thank you, makes sense. I assume it has been occurring throughout 2.x... but seems odd, I thought such an obvious case had been tested against. |
@cowtowncoder We were surprised too... Hopefully you reacted quickly ;-) Thx. |
StdDateFormat
fails to parse 'zulu' date when TimeZone other than UTC
@brenuart Thanks -- I figured it out. It's sort of obvious in hindsight: since JDK does (did?) not support |
The
StdDateFormat
fails to properly parse 'zulu' dates when the ObjectMapper has its timezone set to other than UTC. It appears the parser removes the trailingZ
when found and construct a newjava.util.Date
instance using the timezone of the mapper instead of forcing it to UTC.The example below illustrates the problem. It parses the representation of EPOCH in zulu format once with the mapper in its default configuration and a second time with its timezone set to GMT+1.
Because the trailing
Z
should be considered as a UTC timezone indicator, both cases should lead to the same date which is not the case.The text was updated successfully, but these errors were encountered: