java.text.ParseException:无法解析的日期:“ CET 2012年1月11日星期三00:00:00”; [英] java.text.ParseException: Unparseable date: "Wed Jan 11 00:00:00 CET 2012"

查看:148
本文介绍了java.text.ParseException:无法解析的日期:“ CET 2012年1月11日星期三00:00:00”;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个日期我有下一个问题:

I have the next problem with this date:

java.text.ParseException: Unparseable date: "Wed Jan 11 00:00:00 CET 2012"

我有这个:

 DateFormat formatter ; 
      Date dateIn=null;  
       formatter = new SimpleDateFormat( "EEE MMM dd HH:mm:ss yyyy" ); 
       try {
        dateIn = (Date)formatter.parse(dateI);
    } catch (ParseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } 

我在做什么不好?谢谢

推荐答案

使用时区和语言环境

SimpleDateFormat( "EEE MMM dd HH:mm:ss z yyyy", Locale.US);

在输入字符串(日期和月份名称)中反映英语。

to reflect English language in the input string (days and month names).

这篇关于java.text.ParseException:无法解析的日期:“ CET 2012年1月11日星期三00:00:00”;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆