Skip to content

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

@brenuart

Description

@brenuart

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions