Spring 3.2 Date time format

后端 未结 5 1677
情话喂你
情话喂你 2020-12-06 06:18

I am using standalone Spring framework and I want to implement Spring 3.2 @DateTimeFormat(pattern = \"dd/mm/yyyy\"), but not getting the expected output.

My code sni

5条回答
  •  鱼传尺愫
    2020-12-06 06:59

    Try changing the format to :

    @DateTimeFormat(pattern = "dd/MM/yyyy")
    

    MM is for months , mm for minutes .

    Just look at this documentation:

    The most common ISO DateTime Format yyyy-MM-dd'T'hh:mm:ss.SSSZ e.g.

提交回复
热议问题