FasterXML / FasterXML/jackson-modules-java8

java9+ OffsetDateTimeSerializer/OffsetDateTimeDeserializer miliseconds instead of nano config

未关闭
#161 8 条评论 5 个 reaction 已指派 1 人 已被 @kupci 认领 在 GitHub 查看
主要语言
Java
星标
425
派生
124
PR 合并指标
30 天内没有已合并 PR

描述

Hi,
we have set `SerializationFeature.WRITE_DATES_AS_TIMESTAMPS` to `false` and in java8 it wrote time in milliseconds precision (java worked this way for a long time).
After migrating to java11 the precision is nanoseconds
* (Java 8- - 2020-01-28T16:31:37.698+01:00)
* (Java 9+ - 2020-01-28T16:31:37.698185+01:00)

This is fine, but unfortunately the services both northbound and southbound of our system can work with milliseconds (3 digits).
Would it be possible to create a `SerializationFeature` to enable java8 behavior meaning serializing only to milliseconds precision?
We use a spring boot autoconfiguration where we would like to set this globally for all of our microservices.

Thanks,
Ondrej

PS: Maybe until then, could you provide us instructions for the best way to setup this in Spring Boot 2.2.x?
Thanks

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。