com.codename1.l10n.ParseException: Invalid timezone value in codenameone

↘锁芯ラ 提交于 2020-01-14 06:06:06

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!