FasterXML / jackson-datatype-joda

Extension module to properly support full datatype set of Joda datetime library
Apache License 2.0
140 stars 82 forks source link

SerializationFeature.WRITE_DATES_WITH_ZONE_ID writes inconsistent Zone Offset #73

Closed fabianbuch closed 9 years ago

fabianbuch commented 9 years ago

With SerializationFeature.WRITE_DATES_WITH_ZONE_ID turned on I get serialized dates like "1970-01-01T00:00:00.000Z[Europe/London]" instead of the expected "1970-01-01T00:00:00.000+01:00[Europe/London]".

jackson-datatype-jsr310 module seems to serialize it correctly.

Unit test:

public void testWriteDatesWithZoneId() throws Exception
{
    ObjectWriter w = MAPPER.writer();

    w = w.with(SerializationFeature.WRITE_DATES_WITH_ZONE_ID);

    assertEquals(quote("1970-01-01T00:00:00.000+01:00[Europe/London]"),
            w.without(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
                    .writeValueAsString(DATE_JAN_1_1970_EUROPE_LONDON));
}