Skip to content

JacksonAutoConfiguration with better default time zone #17414

@imbyungjun

Description

@imbyungjun

JacksonAutoConfiguration configures default time zone as UTC (L136).
But, if want to use the default time zone, there's no way to achieve it with autoconfiguration. To achieve the default time zone, we must register a custom message converter bean.

Using the default date format with the default time zone looks more convenient. In this case, if want to use UTC time zone, we can easily set it up in spring.jackson.time-zone property.

Default time zone should be like this

new JacksonJodaDateFormat(DateTimeFormat.forPattern(jacksonProperties.getDateFormat()).withZone(DateTimeZone.getDefault());

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions