Spring 3.2 Date time format
spring
Solution
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.
Problem
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 snippet is: ``` @DateTimeFormat(pattern = "dd/mm/yyyy") private Date dob; public void amehotd(){ Calendar cal; cal = Calendar.getInstance (); cal.set (1999, Calendar.AUGUST, 30); this.dob = cal.getTime(); System.out.println(dob) } ``` Gives following result: ``` Mon Aug 30 15:08:14 CDT 1999 ``` but I was expecting output like: 30/08/1999 I want to implement without joda time library