-1

I want to know the name of current date time and year and count how many days in current month

Ye Htet Nyi
  • 21
  • 2
  • 6

1 Answers1

3
int iYear = 2000;
int iMonth = Calendar.January;
int iDay = 1;

// Create a calendar object and set year and month
Calendar mycal = new GregorianCalendar(iYear, iMonth, iDay);

// Get the number of days in that month
int daysInMonth = mycal.getActualMaximum(Calendar.DAY_OF_MONTH); 
archon92
  • 447
  • 3
  • 13