Im trying to get the number of the month (from 1 to 12) of the year and the year.
But when i use that code it give me only the number 2 for the month and the number 1 for the year.
Calendar calendar=Calendar.getInstance();
String currentdate;
SimpleDateFormat sdf=new SimpleDateFormat("dd/MM/YYYY");
currentdate=sdf.format(calendar.getTime());
Calendario.gprec=calendar.DAY_OF_MONTH;
Calendario.mprec=calendar.MONTH;
Calendario.aprec=calendar.YEAR;
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…