I'm developing a method where I can get the date, month, and year to create a security key to connect to the server. But I have already verified the date of my emulator and my cell phone is correct, but the month comes with the previous month.
My code is as follows.
Calendar c = new Calendar.getIntance();
int ano = c.get(Calendar.YEAR);
int dia =c.get(Calendar.DAY_OF_MONTH);
int mes = c.get(Calendar.MONTH);
Has anyone ever had this problem with Calendar
?
The year and day are coming correct, only month is coming with a previous month.