I get it:
Calendar c = new GregorianCalendar();
mYear=c.get(Calendar.YEAR);
mMonth=c.get(Calendar.MONTH);
mDay=c.get(Calendar.DAY_OF_MONTH);
And this:
Date d = c.getTime();
int day = d.getDay();
int month = d.getMonth();
int year= d.getYear();
Different numbers multiply, is there some kind of initialization that I don't see? I care because I use ORMLite and try to store dates in a database that is a Date object, but Date is outdated and therefore I try to use a calendar, but it doesn’t seem so simple, because the above code leads to different answers for day, month and year.
source
share