LocalDateTime 接收JSON和转JSON使用注解

前端接收的时间为字符串也可以使用这样。

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;

image

posted @ 2023-04-23 16:43  皮豪  阅读(369)  评论(0编辑  收藏  举报