List of utility methods to do Month Format
String | addMonths(String src, int addMonth, String format) add Months SimpleDateFormat formatter = new SimpleDateFormat(format, Locale.UK); SimpleDateFormat informatter = new SimpleDateFormat("yyyyMMdd", Locale.UK); SimpleDateFormat yearFormat = new SimpleDateFormat("yyyy", Locale.UK); SimpleDateFormat monthFormat = new SimpleDateFormat("MM", Locale.UK); SimpleDateFormat dayFormat = new SimpleDateFormat("dd", Locale.UK); DecimalFormat fourDf = new DecimalFormat("0000"); DecimalFormat twoDf = new DecimalFormat("00"); Calendar calendar = Calendar.getInstance(Locale.UK); ... |
String | formatMonth(Date date) format Month if (date == null) { return null; return new SimpleDateFormat(monthFormat).format(date); |
String | formatMonth(Date date) format Month if (date == null) { return NOT_DEFINED_DATE; return monthDF.format(date.getTime()); |
String | formatMonth(final Date date) Format the Date using pattern "yyyy-MM" return formatMonth(date, null);
|
String | formatMonth(final int year, final int month) format Month final StringBuffer buf = new StringBuffer(); buf.append(year); if (month >= 0) { buf.append('-'); final int m = month + 1; if (m <= 9) { buf.append('0'); buf.append(m); return buf.toString(); |
String | formatMonth(int month) format Month return MONTH_FORMAT[month];
|
String | formatMonth(int month, Locale locale, boolean longFormat) format Month SimpleDateFormat sdf = new SimpleDateFormat("", getSafeLocale(locale)); if (longFormat) return sdf.getDateFormatSymbols().getMonths()[month]; else return sdf.getDateFormatSymbols().getShortMonths()[month]; |
String | formatMonth(String dateOrign) format Month String dateString = ""; try { dateString = new SimpleDateFormat("ddMMMyyyy", Locale.US) .format(new SimpleDateFormat("yyyy-MM-dd").parse(dateOrign)); } catch (Exception e) { return ""; return dateString; ... |
String | formatMonthDay(int decimal) format Month Day DecimalFormat df = new DecimalFormat("00"); return df.format(decimal); |
String | formatMonthlyPeriod(String month) format Monthly Period String[] monthNames = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; StringBuffer formattedPeriod = new StringBuffer(); String m = month.substring(0, month.indexOf(" ")); String y = month.substring(month.indexOf(" ") + 1, month.length()); int mnth = -1; for (int i = 0; i < monthNames.length; i++) { if (monthNames[i].equals(m)) { ... |