List of utility methods to do Date to Month
Date | getMonday(Date date) get Monday Calendar c = Calendar.getInstance();
c.setTime(date);
c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
return c.getTime();
|
String | getMondayDate(String date) get Monday Date String startDate; int year = getYear(date); int month = getMonth(date); int day = getDate(date); int curDayOfWeek = getDayOfWeek(year, month, day); int startTmp = 2 - curDayOfWeek; if (startTmp == 0) return date; ... |
String | getMontByDate(Date curDate) get Mont By Date if (curDate == null) return ""; Calendar cal = Calendar.getInstance(); cal.setTime(curDate); int monthNum = cal.get(Calendar.MONTH) + 1; return Integer.toString(monthNum); |
Integer | getMonth(Date aDate) get Month Calendar cal = new GregorianCalendar(); cal.setTime(aDate); return new Integer(cal.get(Calendar.MONTH) + 1); |
int | getMonth(Date d) get Month if (d == null) return 0; final Calendar c = new GregorianCalendar(); c.setTime(d); return c.get(Calendar.MONTH) + 1; |
int | getMonth(Date d) Jan = 1 ... Calendar c = getCalendar();
c.setTime(d);
return (c.get(Calendar.MONTH) + 1);
|
Date[] | getMonth(Date d) get Month Date[] dS = new Date[2]; Calendar calendar = Calendar.getInstance(); calendar.setTime(d); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH)); dS[0] = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); dS[1] = calendar.getTime(); return dS; ... |
int | getMonth(Date d) get Month Calendar c = Calendar.getInstance();
c.setTime(d);
return c.get(Calendar.MONTH) + 1;
|
Integer | getMonth(Date date) get Month if (date == null) { return null; Calendar ca = Calendar.getInstance(); ca.setTime(date); return Integer.valueOf(ca.get(MONTH) + 1); |
int | getMonth(Date date) Get the month of the specified date. GregorianCalendar cal = getCalender(date, false);
return cal.get(Calendar.MONTH);
|