日付変換>着信時間2015-12-31 T 12:05:02+08:00出力時間2017-09-08 16:25:00
593 ワード
/**
*
* @param gc
* @return
* 2015-12-31T12:05:02+08:00 2017-09-08 16:25:00
*/
public String DateToXML(String gc){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String str="";
try{
SimpleDateFormat sd=new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");
Date date=sd.parse(gc);
str=sdf.format(date);
}
catch(Exception e)
{
return str;
}
return str;
}