java string类型转化为date类型

string datdString='Wed Oct 12 2016 00:00:00 GMT+0800 (中国标准时间)'将字符串转化为date类型,格式2016-10-12

String datdString="Wed Oct 12 2016 00:00:00 GMT+0800 (中国标准时间)";
datdString = datdString.replace("GMT", "").replaceAll("\(.*\)", "");
//将字符串转化为date类型,格式2016-10-12
SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd yyyy hh:mm:ss z",Locale.ENGLISH);
Date dateTrans = format.parse(datdString);
System.out.println(new SimpleDateFormat("yyyy-MM-dd").format(dateTrans));

String d = "Wed Oct 12 2016 00:00:00 GMT+0800";
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd yyyy hh:mm:ss z",Locale.ENGLISH);
try {
System.out.println(sdf.parse(d));
} catch (Exception e) {
}

用SimpleDateFormat来转换 String转Date

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = sdf.parse("1999-09-09 12:09:12");

Date 转 String
Date d = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String strDate = sdf.format(d);

好像不可以吧……我用过这个方法

String datdString = "Wed Oct 12 2016 00:00:00 GMT+0800";
String d = "Wed Oct 12 2016 00:00:00 GMT+08:00";
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd yyyy hh:mm:ss z",Locale.ENGLISH);
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
try {
System.out.println("【】" + sdf1.format(sdf.parse(d)));
} catch (Exception e) {
System.out.println("【】");
}

            要把GMT+0800改成GMT+08:00
            输出结果:
            //【】2016-10-12

用SimpleDateFormat来转换 String转Date

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = sdf.parse("1999-09-09 12:09:12");

Date 转 String
Date d = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String strDate = sdf.format(d);

试一下simpleDateFomat,转成Date再toLocaleString