问题
I'm doing a sample in CN1 and in this sample i tried to convert the date from one pattern to another.
here is method what i'm using :
private String convertDateFormat(String fromDate) {
DateFormat df=new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
Date d= null;
try {
d = df.parse(fromDate);
} catch (ParseException e) {
e.printStackTrace();
}
df=new SimpleDateFormat("yyyyMMdd");
System.out.println(df.format(d));
return df.format(d);
}
calling the method
String convertedDate = convertDateFormat("Sun Aug 14 16:13:39 GMT+05:30 2016");
and above code is working in simulator but when i runs in the device i'm getting this "com.codename1.l10n.ParseException: Invalid timezone value" Exception..
How can i fix this?
来源:https://stackoverflow.com/questions/46743714/com-codename1-l10n-parseexception-invalid-timezone-value-in-codenameone