String 时间格式的切换

String textValue = "Thu Aug 27 18:05:49 CST 2015";    
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);    
Date d = sdf.parse(textValue);    
textValue = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(d);    
System.out.println(textValue);  

猜你喜欢

转载自blog.csdn.net/qq_29864935/article/details/79148965