Skip to content

Backward compatibility for timezone formats of UTC Date serialization #3284

@arungitan

Description

@arungitan

Is your feature request related to a problem? Please describe.

This is related to 07422d3
Since the default serialization of Date is changing timezone offset from "+00:00" to "Z" (in Jackson 3.0), would it be possible to have some options in 3.x to produce the old backward compat formats "+0000" and "+00:00"?
We have some existing APIs which produce "+0000" and where (some) users are very sensitive to any change in the format. we were able to address this in 2.11 setting the provided colon flag to false. What would be the options to produce the same outputs in 3.x?

Describe the solution you'd like
some flag (or other mechanism) that would allow default Date serialization to optionally produce the legacy "+0000" and "+00:00" timezone offset formats instead of the default "Z"

Usage example
one possibility could be similar to the colon flag in 2.11.
StdDateFormat::withLegacyTimeZoneForUTC(boolean useColon)

Additional context
As mentioned above, this would help support backward compatibility of Date fields in existing api responses with minimal impact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.xIssues to be only tackled for Jackson 3.x, not 2.xdate-time-configWork related to possible larger DateTimeConfig featurepr-welcomeIssue for which progress most likely if someone submits a Pull Request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions