How to globally configure `@DateTimeFormat` pattern in Spring Boot?

前端 未结 3 859
深忆病人
深忆病人 2021-02-08 01:48

Im my Spring Boot application, I have some controllers that accept a date as query parameter:

@RestController
public class MyController {

  @GetMapping
  public         


        
3条回答
  •  孤街浪徒
    2021-02-08 02:28

    @britter: thanks.

    spring.mvc.date-format= # Date format to use. For instance, dd/MM/yyyy works fine with Spring Boot 2.1.0.x

    See # SPRING MVC (WebMvcProperties) properties.

    UPDATE: But it doen't work for Spring Data Rest params ...

提交回复
热议问题