我想在我的活动中获取日期并显示我今天执行此代码但工作错误
private int mYear;
private int mMonth;
private int mDay;
String Date
final Calendar c = Calendar.getInstance();
mYear = c.get(Calendar.YEAR);
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
Date = mDay + "-" + mMonth + "-" + mYear;
它显示18-11-2012
这是错误的,但它让我感到困惑,即使月份是 12,为什么月份显示 11 有什么问题?