SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMdd");
try{
System.out.println(format1.format(format1.parse("20090801")));
}catch(Exception e){
}
上面運行結果是20090801
SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMdd");
try{
System.out.println(format1.format(format1.parse("2009-08-01")));
}catch(Exception e){
}
上面運行兩次以上的結果是20081208