來獲得當前日期和時間爲什麼當前的日期保存爲3912?
final Calendar c = Calendar.getInstance();
mYear = c.get(Calendar.YEAR);
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
mHour = c.get(Calendar.HOUR_OF_DAY);
mMinute = c.get(Calendar.MINUTE);
創建當前日期的對象
Date toDate;
toDate.setYear(mYear);
toDate.setMonth(mMonth);
toDate.setDate(mDay);
Date endDate = toDate;
打印時結束日期對象我
Mon Jan 01 13:11:00 GMT+03:00 3912
爲什麼呢?
y2.012K錯誤導致的問題 – 2012-01-01 11:24:34
是你的系統時間設置爲正確的一年? – Andrew 2012-01-01 11:23:07