I am using Spring annotation while passing datetime as string from frontend to validate that date pattern and convert that string to datetime.I want to generate a joda datetime object of local timezone for a date as in the code given below:
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
@JsonDeserialize( using = DateTimeDeSerializer.class )
private DateTime lastModifiedDate;
DateTimeDeSerializer.java
DateFormatter dateFormatter = new DateFormatter("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
Locale locale=new Locale("en");
String date = "2016-04-19T17:22:29.296+05:30";
DateTime localDatime = new DateTime(dateFormatter.parse(date , locale));
I am getting "Unparseable date: "2016-04-19T17:22:29.296+05:30".Any suggestions for solving this will be of great help.