Java中String value="Wed Sep 16 19:02:36 CST 2009";这种格林威治时间怎么将他转回Date类型??跪求大神指教。
------解决方案--------------------
String value = "Wed Sep 16 19:02:36 CST 2009";
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss 'CST' yyyy", Locale.US);
Date d = sdf.parse(value);
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(sdf2.format(d));
------解决方案--------------------
String value="Wed Sep 16 19:02:36 CST 2009";
DateFormat df=new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy",Locale.US);
Date date=df.parse(value);
System.out.println(date);
------解决方案--------------------
String value = "Wed Sep 16 19:02:36 CST 2009";
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss 'CST' yyyy", Locale.US);
Date d = sdf.parse(value);
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(sdf2.format(d));