List of utility methods to do Month Day
String | getMonthEndDay(String time) get Month End Day String ntime = ""; try { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Date startDate = df.parse(time); int nowMonth = startDate.getMonth() + 1; int nextMonth = nowMonth + 1; int nowYear = startDate.getYear() + 1900; String nextTime = nowYear + "-" + nextMonth + "-1"; ... |
String | getMonthEndDay(String yyyy, String mm) get Month End Day if (yyyy == null || yyyy.trim().equals("")) { yyyy = getYear(); if (mm == null || mm.trim().equals("")) { mm = getMonth(); int year = Integer.parseInt(yyyy); int month = Integer.parseInt(mm); ... |
Date | getMonthFirstDay() get Month First Day int mondayPlus; Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); cal.set(Calendar.DAY_OF_MONTH, 1); return getDate(cal.getTime()); |
String | getMonthFirstDay() get Month First Day Date date = new Date(); int nowMonth = date.getMonth() + 1; int nowYear = date.getYear() + 1900; String startTime = nowYear + "-" + nowMonth + "-1"; return startTime; |
Date | getMonthFirstDay(Date date) get Month First Day Calendar c = Calendar.getInstance(); c.setTime(date); int year = c.get(Calendar.YEAR); int month = c.get(Calendar.MONTH); c.clear(); c.set(Calendar.YEAR, year); c.set(Calendar.MONTH, month); c.set(Calendar.DAY_OF_MONTH, 1); ... |
Date | getMonthFirstDay(String date) get Month First Day SimpleDateFormat format = new SimpleDateFormat("yyyy-MM"); Date d = null; try { d = format.parse(date); } catch (Exception e) { e.printStackTrace(); Calendar cal = Calendar.getInstance(); ... |
T | getMonthFirstDay(T date) get Month First Day if (date == null) return null; String dateStr = format(date, "yyyy-MM") + "-01"; Long mill = parseDate(dateStr).getTime(); T another = (T) date.clone(); another.setTime(mill); return another; |
Date | getMonthFristWeekSunday(String month) get Month Frist Week Sunday Calendar c = Calendar.getInstance(); c.setTime(parse(month, "yyyy-MM")); c.set(Calendar.DATE, 1); int dayNum = c.get(Calendar.DAY_OF_WEEK); c.add(Calendar.DATE, 1 - dayNum); return c.getTime(); |
String | getMonthLastDay() get Month Last Day Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
return convertDate(calendar.getTimeInMillis());
|
String | getMonthLastDay() get Month Last Day SimpleDateFormat sdf = new SimpleDateFormat("dd"); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); return sdf.format(calendar.getTime()); |