I have a date from a server in format 01/01/2012 12:00:00PM and I want to convert that date to ISO8601 format but I keep getting a Parse Exception when I try to parse the date
my code
DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mmZ");
Date timestamp = null;
try{
timestamp = format.parse(startDate);
startDate = format.format(timestamp);
}catch(ParseException e){
}
First parse your String and create Date object with incoming format.
Then create another date format with the format you are looking for and format the date object.