我想要將系統日期保存到數據庫中,但是返回的結果是: 22/0/2013
代碼:
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
int month_ = cal.get(Calendar.MONTH);
int day_ = cal.get(Calendar.DATE);
String FullDate = (""+day_+"/"+month_+"/"+year);
String text_Rate=(String.valueOf(FullDate));
Log.d("System Date show", text_Rate);
在哪出錯了呢?謝謝
cal.get(Calendar.MONTH)的范圍是0-11,所以你要+1