Spring 3.2 Date time format

后端 未结 5 1679
情话喂你
情话喂你 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:58

    You are calling System.out.println directly in a method of your class. This can't work that way.

    You have to call the dob field from outside of your class, for instance from a JSP page. And this way, the field will be automatically formatted to the given pattern.

提交回复
热议问题