I want to know the name of current date time and year and count how many days in current month
Asked
Active
Viewed 2,579 times
1 Answers
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