package com.webkfa.test;
/**
* web开发技术提供
* 网址:http://www.webkfa.com
*/
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Test {
public static void main(String[] args) throws IOException, ParseException{
String time ="2014-09-23T10:34:32.000+0800";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
Date date = sdf.parse(time);
System.out.println(date.toLocaleString());
//如果时区有:号
time ="2014-09-23T10:34:32.000+08:00";
time=time.replaceAll(":","");
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd'T'HHmmss.SSSZ");
Date date1 = sdf1.parse(time);
System.out.println(date1.toLocaleString());
}
}