List of utility methods to do Day in Month
String | getPreMonthDayStr(String curday) get Pre Month Day Str int year = getYear(curday); String monthStr = getMonth(curday); int month = Integer.parseInt(monthStr); if (month <= 1) { month = 12; year = year - 1; } else month = month - 1; ... |
String | getStartMonthDayOfDate(String yyyyMM) get Start Month Day Of Date return yyyyMM + "01"; |
boolean | is31DaysMonth(int month) Verify if a given month has 31 days or not. int[] months31 = { 0, 2, 4, 6, 7, 9, 11 }; for (int i = months31.length - 1; i >= 0; i--) { if (months31[i] == month) { return true; return false; |
boolean | isDayMonth(String types) is Day Month if (DATE_TIME_LEVEL_TYPE_MONTH.equals(types)) return true; else return false; |
boolean | isDayOfMonth(int num) is Day Of Month return isNumBetween(1, num, 31);
|
boolean | isLastDayOfMonth(int day, int month, int year) Verify if the given date is the last day in the month. if (month == 1) { return isLeapYear(year) ? day == 29 : day == 28; } else { return is31DaysMonth(month) ? day == 31 : day == 30; |
int | maxDayOfMonth(int year, int month) max Day Of Month if (month <= 0 || month > 12) { return -1; int day = 0; switch (month) { case 2: day = 28; break; ... |
int | monthDays(int y, int m) month Days if ((lunarInfo[y - 1900] & (0x10000 >> m)) == 0) return 29; else return 30; |
int | numDaysInMonth(int month) num Days In Month switch (month) { case 2: return 28; case 4: case 6: case 9: case 11: return 30; ... |
String | padMonthOrDay(String mod) Pad the month or day with a leading zero if (mod.matches("\\d{2}")) { return mod; } else if (mod.matches("\\d")) { return "0" + mod; } else { return ""; |