I am trying to convert the date entered by my app user as String to ISO 8601 format using Joda-Time, so I am using the following code but I get error:
String oldDate = "05/05/2013";
DateTime oldD = DateTime.parse(oldDate);
DateTimeFormatter OldDFmt = ISODateTimeFormat.dateTime();
String str = OldDFmt.print(oldD);
System.out.println(str);
but I am always getting error:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: Invalid format: "05/05/2013" is malformed at "/05/2013"
Can someone please help and tell me what I am doing wrong here? Thanks.