List of utility methods to do Month Get
String | getMonth(String tempdat, Locale locale) This method parses the @param String tempdat, according to a specified format style determined by the @param Locale locale to a Date. DateFormat df = DateFormat.getDateInstance(DateFormat.FULL, locale); Date d = df.parse(tempdat, new ParsePosition(0)); Calendar cal_date = new GregorianCalendar(); cal_date.setTime(d); int monat = 0; monat = cal_date.get(Calendar.MONTH) + 1; String monatstr = String.valueOf(monat); return monatstr; ... |
Date | getMonth1D() get Month D return getMonth1D(new Date()); |
String | getMonthAdd(String operateDate, int flag) get Month Add if (operateDate.length() == 7) { operateDate = operateDate + "-01"; DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar c1 = Calendar.getInstance(); c1.setTime(sdf.parse(operateDate)); c1.add(Calendar.MONTH, flag); return sdf.format(c1.getTime()).substring(0, 7); ... |
String | getMonthAndDate() get Month And Date return mmDDDateFmt.format(new Date()); |
String | getMonthBefore(Date d, int number) get Month Before SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.add(Calendar.MONTH, number); calendar.add(Calendar.DAY_OF_MONTH, -1); return formatter.format(calendar.getTime()); |
String | getMonthBegin(String strdate) get Month Begin Date date = parseDate(strdate); return format(addDate(null, 0), "yyyy-MM") + "-01"; |
String | getMonthBegin(String strdate) get Month Begin java.util.Date date = parseDate(strdate); return format(date, "yyyy-MM") + "-01"; |
Date | getMonthByNow(int month) get Month By Now SimpleDateFormat simpleDateFormatMM = new SimpleDateFormat("yyyy-MM"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Calendar c = Calendar.getInstance(); c.setTime(new Date()); c.add(Calendar.MONTH, month); Date mb = c.getTime(); String mon = simpleDateFormatMM.format(mb); StringBuffer stringBuffer = new StringBuffer(); ... |
int | getMonthCount(String from, String to) get Month Count return getMonthCount(from, to, DATE_FORMAT.toPattern());
|
String | getMonthDesc(Date month) This method is used for getting month description SimpleDateFormat sdf = new SimpleDateFormat(); sdf.applyPattern("MM"); return sdf.format(month).toUpperCase(); |