Giter Club home page Giter Club logo

springboot-jackson-datetime-example's Introduction

Spring Boot & Jackson 对于日期时间类型处理的例子

本文使用的是Spring Boot 1.5.4.RELEASE、Spring 4.3.9.RELEASE、Jackson 2.8.8、Joda 2.9.9

Spring Boot利用JacksonAutoConfiguration自动配置了ObjectMapper,并且在Spring MVC中全局性的使用了它,这样开发者就能够很方便实现Json序列化、反序列化。

不过Jackson对于日期时间类型的行为存在一些坑,一不小心就可能发生无法反序列化以及序列化的结果不符合预期,所以本文罗列了一些例子,帮助开发者获得正确的结果。

重要事项

在写本文的时候发现了一些Jackson和时区有关的Bug,见这里:

要等到确认后再完善本文,所以所有和java.time.ZonedDateTimeorg.joda.time.DateTime相关的结果不能算数。

springboot-jackson-datetime-example's People

Contributors

chanjarster avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.