Android Utililty Methods Month String Get

List of utility methods to do Month String Get

Description

The list of methods to do Month String Get are organized into topic(s).

Method

StringgetCurMonthStr()
get Cur Month Str
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH) + 1;
return getDate(year, month);
StringgetLastMonthStr()
get Last Month Str
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH) + 1;
if (--month == 0) {
    month = 12;
    year--;
return getDate(year, month);
...
StringgetMonthBefore(String format)
get Month Before
SimpleDateFormat sdf = new SimpleDateFormat(format);
Calendar c = Calendar.getInstance();
c.setTime(new Date());
c.add(Calendar.MONTH, -1);
return sdf.format(c.getTime());
StringgetMonthString(int month, int abbrev)
Return a localized string for the month of the year.
int[] list;
switch (abbrev) {
case LENGTH_LONG:
    list = sMonthsLong;
    break;
case LENGTH_MEDIUM:
    list = sMonthsMedium;
    break;
...
StringgetMonthStringByIndex(int index)
get Month String By Index
switch (index) {
case 1:
    return "Jan";
case 2:
    return "Feb";
case 3:
    return "Mar";
case 4:
...
StringgetReadableMonth(int month)
get Readable Month
return MONTH[month - 1];
StringgetCurrentMonth()
get Current Month
return getFormatCurrentTime("MM");
String[]getMonthNames()
get Month Names
return getMonthNames(Locale.getDefault(), LONG);
String[]getMonthNames(Locale l, int len)
get Month Names
String[] s;
if (len == SHORT)
    s = new DateFormatSymbols(l).getShortMonths();
else
    s = new DateFormatSymbols(l).getMonths();
return s;
String[]getShortMonths()
get Short Months
return getMonthNames(Locale.getDefault(), SHORT);