我有4位數的日期。我遇到了2050年以後的投入。在我的申請"0150"
意味着January 01 2050
。但是,當我格式化它返回下面的輸出。爲什麼格式化日期給上個世紀
Sun Jan 01 00:00:00 PKT 1950
public static Date getFormatDate(String newformat, String dateValue) throws Exception {
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(newformat);
java.util.Date newdate = simpleDateFormat.parse(dateValue);
return newdate;
}
catch(Exception e) {
System.out.println("Exception in converting date format --->" + e);
throw e;
}
}
public static void main(String[] args) throws Exception {
System.out.println(getFormatDate("MMyy", "0150"));
}
任何幫助解決此問題將不勝感激。
這只是2013年,人們已經試圖再次削減世紀? – CPerkins 2013-04-09 13:07:23