List of utility methods to do Month Convert
String | createFutureDate(int days, int months) Creates a new date/time string presented in the SIP2 format "yyyyMMdd HHmmss" by adding the given number of days and months to the current date. Calendar date = Calendar.getInstance(); date.setTime(new Date()); date.add(Calendar.DATE, days); date.add(Calendar.MONTH, months); return toSipDateTime(date.getTime()); |
int | differenceMonth(String strDate1, String strDate2) difference Month Date date1 = DateFormat.getDateInstance().parse(strDate1);
Date date2 = DateFormat.getDateInstance().parse(strDate2);
return differenceMonth(date1, date2);
|
Boolean | isCurMonth(String month) is Cur Month SimpleDateFormat daytime = new SimpleDateFormat("yyyyMM"); Calendar calendar = Calendar.getInstance(); String curMonth = daytime.format(calendar.getTime()); return month.equals(curMonth); |
String | month() month return now("MM"); |
String | month(Date date, Locale locale) month Calendar c = Calendar.getInstance(locale); c.setTime(date); DateFormatSymbols symbols = new DateFormatSymbols(locale); return symbols.getMonths()[c.get(Calendar.MONTH)]; |
String | month2String(Date date) month String DateFormat format1 = new SimpleDateFormat("M.dd"); return format1.format(date); |
String | monthAgo() month Ago Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); cal.add(Calendar.DAY_OF_MONTH, -30); return convertDate2String5(cal.getTime()); |
int | monthConvertToNumber(String str) month Convert To Number switch (str) { case "Jan": return 1; case "Feb": return 2; case "Mar": return 3; case "Apr": ... |
String | monthformMatDate(Date date) monthform Mat Date return smdf.format(date);
|
String | monthIndexAsString(Integer index, Integer offset) month Index As String if (index == null) { return ""; index = index - offset + 1; String result = ""; SimpleDateFormat numberFormat = new SimpleDateFormat("MM"); SimpleDateFormat stringFormat = new SimpleDateFormat("MMMM", Locale.US); try { ... |