首页 > 代码库 > java中Thursday 05 September 2002类型时间的转化

java中Thursday 05 September 2002类型时间的转化


package config;

import Java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;


public class Test {
public static void main(String[] args) {
String s="Mon Mar 30 00:00:00 CST 2015";

Date f = new Date(s);
try {
String c = new SimpleDateFormat("yyyy-MM-dd").format(f);
System.out.println(c);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} }
}

java中Thursday 05 September 2002类型时间的转化