I am trying to parse a string of format
Thu Apr 07 11:45:28 AEST 2016
into date object. My code looks like following:
SimpleDateFormat parserSDF = new SimpleDateFormat("EEE MMM d HH:mm:ss zzz yyyy");
try{
Date time = parserSDF.parse("Sat Feb 01 15:00:19 AEDT 2014");
}catch(Exception e){
e.printStackTrace();
}
But I am getting a 'parse error'. I cannot change the input format of the date and I also cannot set my timezone to a static value as this code is to be run on andorid device. How can I parse this string into date ?
答案 0 :(得分:2)