I am using the following piece of code to parse a date –
DateFormat dateFormatIn = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.S'Z'");
String ts = "2011-06-15T17:34:09.291Z";
String timestamp = dateFormatIn.format(ts);
It throws me an IllegalArgumentException. Any idea what is the right way to go about it?
DateFormat.format() expects a
Dateas parameter and not aString.http://developer.android.com/reference/java/text/DateFormat.html#format(java.util.Date)
U need to use DateFormat.parse() to get the Date