List of utility methods to do Month Get
String | currentMonth() current Month return yyyyMM.format(new Date()); |
String | currentMonthStr() current Month Str return getTimeForMormat(new Date(), FORMAT_MONTH); |
String | getAktMonthName() get Akt Month Name return MONTHS[Calendar.getInstance().get(Calendar.MONTH)];
|
List | getAllMonths(String date1, String date2) get All Months date1 = date2String1(string2Date(date1)) + "-01"; date2 = date2String1(string2Date(date2)) + "-01"; List list = new ArrayList(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Calendar startDay = Calendar.getInstance(); Calendar endDay = Calendar.getInstance(); try { startDay.setTime(format.parse(date1)); ... |
String | getBeforeMonth(int amount) get Before Month SimpleDateFormat daytime = new SimpleDateFormat("yyyyMM"); Calendar cal = Calendar.getInstance(); cal.setTime(cal.getTime()); cal.add(Calendar.MONTH, -amount); String month = daytime.format(cal.getTime()); return month; |
String | getBeforeOrAfterDate(String strDate, int months) get Before Or After Date DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd"); Date date = null; try { date = df2.parse(strDate); } catch (ParseException e) { e.printStackTrace(); Calendar cal = Calendar.getInstance(); ... |
Long | getCurMonth2Long() get Cur Month Long Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("MM"); return Long.parseLong(sdf.format(date)); |
String | getCurrMonthLastDay() get Curr Month Last Day ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH)); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); String last = format.format(ca.getTime()); return last; |
Date | getEndDateOfMonth(String yyyymmdd) get End Date Of Month SimpleDateFormat sformat = new SimpleDateFormat("yyyy-MM-dd"); String yyyymm = yyyymmdd.substring(0, 7); int year = Integer.parseInt(yyyymm.substring(0, 4)); int month = Integer.parseInt(yyyymm.substring(5)); String endDate = "31"; if (month == 2) if (year % 4 == 0) endDate = "29"; ... |
String | getEngMonth() get Eng Month GregorianCalendar calendar = new GregorianCalendar(); SimpleDateFormat monthForm = new SimpleDateFormat("MMMMM", Locale.ENGLISH); return monthForm.format(calendar.getTime()); |