public static void main(String[] args) {
SimpleDateFormat s1 = new SimpleDateFormat("dd/MM/yyyy");
SimpleDateFormat s2 = new SimpleDateFormat("yyyy-MM-dd");
try {
Date date = s1.parse("01/12/2003");
String s = s2.format(date);
System.out.println(s);
}
catch (Exception ex) {
ex.printStackTrace();
}
}
SimpleDateFormat s1 = new SimpleDateFormat("dd/MM/yyyy");
SimpleDateFormat s2 = new SimpleDateFormat("yyyy-MM-dd");
try {
Date date = s1.parse("01/12/2003");
String s = s2.format(date);
System.out.println(s);
}
catch (Exception ex) {
ex.printStackTrace();
}
}
日期这些东西的处理主要在java.util java.text的包里面呢
多看看api