List of utility methods to do Day in Month
String | currentMonthFirstDay() current Month First Day SimpleDateFormat sdf = new SimpleDateFormat(DATE_PATTERN); Date curDate = new Date(System.currentTimeMillis()); Calendar calendar = Calendar.getInstance(); calendar.setTime(curDate); calendar.set(Calendar.DAY_OF_MONTH, 1); return sdf.format(calendar.getTime()); |
int | dayForMonth(String pTime) day For Month SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Calendar c = Calendar.getInstance(); c.setTime(format.parse(pTime)); int m = c.get(Calendar.DAY_OF_MONTH); return m; |
int | daysInMonth(int month, boolean isLeapYear) days In Month int i = (month - 1) + 12 * (isLeapYear ? 1 : 0); return DAYS_IN_MONTH[i]; |
int | daysInMonth(int month, int year) return the number of days in the month of the year. return daysInMonth[isLeapYear(year) ? 1 : 0][month];
|
int | daysInMonth(int year, int month) days In Month int daysInMonth; switch (month) { case 1: case 3: case 5: case 7: case 8: case 10: ... |
int[] | daysOfMonth(int year) days Of Month if (isLeapYear(year)) { return DAYS_OF_MONTH_IN_LEAP_YEAR; return DAYS_OF_MONTH_IN_NORMAL_YEAR; |
int | daysOfMonth(int year, int month) days Of Month int days = 0; switch (month) { case 1: case 3: case 5: case 7: case 8: case 10: ... |
String | firstDayOfLastMonth() first Day Of Last Month Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, -1);
cal.set(Calendar.DATE, 1);
return String.valueOf(dfDdMMMYYYY.format(cal.getTime()));
|
int | firstDayOfMonth(int commonMonthIndx, int iyear) first Day Of Month return ((commonMonthIndx > 2) ? leapYearBalance(iyear) : 0) + FirstDayOfMonth[commonMonthIndx - 1];
|
String | firstDayOfMonth(int year, int month, String dateFormat) get first day of specified month and specified year in specified date format. Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); cal.add(Calendar.YEAR, year); cal.add(Calendar.MONTH, month); cal.set(Calendar.DAY_OF_MONTH, 1); SimpleDateFormat formatter = new SimpleDateFormat(dateFormat); return formatter.format(cal.getTime()); |