Remember springboot entity class String turn pit type Date

The front end of the string passed as a String time: 2019-07-18 23:59:59

Back-end entity classes to be annotated in the head:

@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

 

 Remember introduced

<dependency>
    <groupId>joda-time</groupId>
    <artifactId>joda-time</artifactId>
    <version>2.3</version>
</dependency>

 

 

jsonformat the date is converted to a String, and the string DatetimeFormat is converted to a date

Guess you like

Origin www.cnblogs.com/uzxin/p/12105662.html