I want to convert the current date to integer value. By default, it returns long. When I try to convert long to integer, and afterwards I convert the integer value to date,
Try This
Calendar currentDay= Calendar.getInstance();
int currDate= currentDay.get(Calendar.DATE);
int currMonth= currentDay.get(Calendar.MONTH);
int currYear= currentDay.get(Calendar.YEAR);
System.out.println(currDate + "-" + currMonth + "-" + currYear);
an alternative way using LocalDate.
LocalDate today = LocalDate.now();
int currentDate= today.getDayOfMonth();
int currentMonth= today.getMonthValue();
int currentYear= today.getYear()