The format string for parsing you're looking for is yyyy-MM-dd'T'HH:mm:ssZ
, however Z
expects a format of +0700
for the time zone, instead of +07:00
, so you need to do some string replacement first, to get rid of the colon.
String stringDate = "2014-03-20T17:59:03+07:00";
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
Date startDate = df.parse(stringDate.replaceAll("([+-]\\d{2}):(\\d{2})$", "$1$2"));
System.out.println(startDate); // output "Thu Mar 20 11:59:03 CET 2014" in my time zone