[DatePickerDialog] Invalid month number
Opened this issue · 0 comments
erlangparasu commented
DatePickerDialog.Builder builder = new DatePickerDialog.Builder() {
@Override
public void onDateChanged(int oldDay, int oldMonth, int oldYear, int newDay, int newMonth, int newYear) {
Log.d(TAG, "onDateChanged: ");
super.onDateChanged(oldDay, oldMonth, oldYear, newDay, newMonth, newYear);
Date newDate = new Date(DateUtils.getTimeForDay(newYear, newMonth, newDay));
}
};
i get:
newMonth = 0 ------> January
newMonth = 1 ------> Feb
...
newMonth = 5 ------> June