Java Utililty Methods Month

List of utility methods to do Month

Description

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

Method

intextractMonthFromDate(String dateString)
extract Month From Date
int start = dateString.indexOf(".") + 1;
int to = dateString.lastIndexOf(".");
return Integer.parseInt(dateString.substring(start, to));
StringfindMonth(String strMonth)
Method findMonth.
String month = "";
if (strMonth.equals("01")) {
    month = "January";
} else if (strMonth.equals("02")) {
    month = "February";
} else if (strMonth.equals("03")) {
    month = "March";
} else if (strMonth.equals("04")) {
...
StringfixMonth(int month)
fix Month
return (month < 10 ? "0" : "") + month;
StringfixMonth(String m)
fix Month
String sm = String.valueOf(m);
String[] lib = { "0", "" };
sm = lib[sm.length() - 1] + sm;
return sm;
StringgetAllowMonth(String startdate, int count)
get Allow Month
String tempdate = getCurMonthDayStr(startdate);
for (int i = 0; i < count; i++) {
    tempdate = getNextMonthDayStr(tempdate);
return tempdate;
StringgetAssignMonth(String date)
get Assign Month
if (date != null && date.length() >= 6)
    return date.substring(4, 6);
return null;
StringgetCurrDateByMonth(String date)
get Curr Date By Month
int day = days(Integer.parseInt(date.substring(0, 4)), Integer.parseInt(date.substring(5, 7)));
return date + "-" + day;
intgetEnligthMonth(String en)
get Enligth Month
int m = 0;
en = en.toLowerCase();
if ("january".indexOf(en) != -1) {
    m = 1;
} else if ("february".indexOf(en) != -1) {
    m = 2;
} else if ("march".indexOf(en) != -1) {
    m = 3;
...
StringgetEnMonth(String month)
get En Month
if (month.equals("01") || month.equals("1")) {
    month = "January";
} else if (month.equals("02") || month.equals("2")) {
    month = "Feburary";
} else if (month.equals("03") || month.equals("3")) {
    month = "March";
} else if (month.equals("04") || month.equals("4")) {
    month = "April";
...
intgetFirstMonthByQuarter(int month)
get First Month By Quarter
int quarter = 0;
if (month >= 1 && month <= 3) {
    quarter = 1;
if (month >= 4 && month <= 6) {
    quarter = 4;
if (month >= 7 && month <= 9) {
...