Android Utililty Methods Month Date Get

List of utility methods to do Month Date Get

Description

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

Method

intgetCurrentMonth()
get Current Month
CALENDAR.setTime(new Date());
return CALENDAR.get(Calendar.MONTH) + 1;
StringgetStringMonth(Date date)
get String Month
Calendar cal = Calendar.getInstance();
SimpleDateFormat month_date = new SimpleDateFormat("MMMM");
return month_date.format(cal.getTime());
StringgetMonth(int month, Locale locale)
get Month
return DateFormatSymbols.getInstance(locale).getMonths()[month - 1];
StringgetMonthName(String substring)
get Month Name
switch (Integer.parseInt(substring)) {
case 1:
    return "Jan";
case 2:
    return "Feb";
case 3:
    return "Mar";
case 4:
...
longgetEndCurrentMonth()
get End Current Month
return getEndCurrentMonthCal().getTimeInMillis();
CalendargetEndCurrentMonthCal()
get End Current Month Cal
Calendar calendar = getCalendar();
calendar.set(Calendar.DAY_OF_MONTH,
        calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return calendar;
...
longgetStartCurrentMonth()
get Start Current Month
return getStartCurrentMonthCal().getTimeInMillis();
CalendargetStartCurrentMonthCal()
get Start Current Month Cal
Calendar calendar = getCalendar();
calendar.set(Calendar.DAY_OF_MONTH,
        calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar;
...