Reasons for failure of using @DateTimeFormat() in springboot

1. The imported package in the entity should be import java.sql.Date; (sql package). Importing the util package by mistake caused it to fail.

2. No dependency is added in pom.xml.

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

3. The time format in @DateTimeFormat() is wrong.

Guess you like

Origin blog.csdn.net/Hambur_/article/details/114262599