Get the milliseconds for a particular date.

@param year The year to use.
@param month The month to use
@param dayOfMonth The day of the month to use
@return millis from 1970-01-01T00:00:00Z
504356
long getYearMonthDayMillis(int year, int month, int dayOfMonth) {
        long millis = getYearMillis(year);
        millis += getTotalMillisByYearMonth(year, month);
        return millis + (dayOfMonth - 1) * (long)DateTimeConstants.MILLIS_PER_DAY;
    }
42659
public static function numberOfDaysInMonth($month = 0, $year = 0)
    {
        if ($month < 1 or $month > 12) {
            return 0;
        }

        if (!is_numeric($year) or strlen($year) != 4) {
            $year = date('Y');
        }

        if ($month == 2) {
            if ($year % 400 == 0 or ($year % 4 == 0 and $year % 100 != 0)) {
                return 29;
            }
        }

        $days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

        return $days_in_month[$month - 1];
    }
668630
public static int getMonth(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        return c.get(Calendar.MONTH);
    }
685662
function getWhatMonth (date, month, day) {
  var monthOffset = month && !isNaN(month) ? month : 0
  date = toStringDate(date)
  if (baseExports.isDate(date)) {
    if (day || !isNaN(day)) {
      if (day === STRING_FIRST) {
        return new Date(_dateFullYear(date), _dateMonth(date) + monthOffset, 1)
      } else if (day === STRING_LAST) {
        return new Date(getDateTime(getWhatMonth(date, monthOffset + 1, STRING_FIRST)) - 1)
      } else {
        date.setDate(day)
      }
    }
    if (monthOffset) {
      date.setMonth(_dateMonth(date) + monthOffset)
    }
  }
  return date
}
1274655
public static int getMonthDay(Calendar cal) {
		int month = cal.get(Calendar.MONTH) + 1;
		int day = cal.get(Calendar.DAY_OF_MONTH);
		int monthDay = month * MONTH_MULTIPLICATOR + day;

		return monthDay;
	}
253042
private static Date getDate(int day, int month, int year) {
		Calendar cal = Calendar.getInstance();
		cal.set(Calendar.YEAR, year);
		cal.set(Calendar.MONTH, month);
		cal.set(Calendar.DATE, day);
		return cal.getTime();
	}
1349328
private int monthLength(int month) {
        int year = internalGet(YEAR);
        if (internalGetEra() == BCE) {
            year = 1 - year;
        }
        return monthLength(month, year);
    }
766792
public static Calendar calendar(long millis) {
		final Calendar cal = Calendar.getInstance();
		cal.setTimeInMillis(millis);
		return cal;
	}
245735
public void setDate(
            final int year,
            final int monthOfYear,
            final int dayOfMonth) {
        Chronology c = getChronology();
        long instantMidnight = c.getDateTimeMillis(year, monthOfYear, dayOfMonth, 0);
        setDate(instantMidnight);
    }
998612
public static boolean isDate(String year, String month, String day) {
        // catch invalid years(not 2- or 4-digit) and invalid months and days.
        if (!(isYear(year) && isMonth(month) && isDay(day))) return false;

        int intYear = Integer.parseInt(year);
        int intMonth = Integer.parseInt(month);
        int intDay = Integer.parseInt(day);

        // catch invalid days, except for February
        if (intDay > daysInMonth[intMonth - 1]) return false;
        if ((intMonth == 2) && (intDay > daysInFebruary(intYear))) return false;
        return true;
    }
1125877
public int getShowMonth() {
        Calendar cal = Calendar.getInstance();
        cal.setTime(getDate());
        return cal.get(Calendar.MONDAY);
    }
429118
public static Date createDate(final int day, final int month, final int year) {
		Calendar cal = Calendar.getInstance();
		cal.clear();

		cal.set(Calendar.DAY_OF_MONTH, day);
		cal.set(Calendar.MONTH, month - 1);
		cal.set(Calendar.YEAR, year);

		return cal.getTime();
	}
715023
public static Date getLastDateOfMonth(Date date) {

        if (date == null)
            return null;

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
        return calendar.getTime();
    }
90020
function getMonth(moment, service, dt) {
	
	const dateService = new service(moment, dt);
  
  return {
    longName: dateService.monthLong(),
    shortName: dateService.monthShort(),
    daysCount: dateService.daysCount(),
    startDayOfMonth: dateService.startDayOfMonth(),
  };
}
1087078
@Nonnegative
  public static java.time.Month getMonth (@Nonnull final Month eMonth)
  {
    switch (eMonth)
    {
      case JANUARY:
        return java.time.Month.JANUARY;
      case FEBRUARY:
        return java.time.Month.FEBRUARY;
      case MARCH:
        return java.time.Month.MARCH;
      case APRIL:
        return java.time.Month.APRIL;
      case MAY:
        return java.time.Month.MAY;
      case JUNE:
        return java.time.Month.JUNE;
      case JULY:
        return java.time.Month.JULY;
      case AUGUST:
        return java.time.Month.AUGUST;
      case SEPTEMBER:
        return java.time.Month.SEPTEMBER;
      case OCTOBER:
        return java.time.Month.OCTOBER;
      case NOVEMBER:
        return java.time.Month.NOVEMBER;
      case DECEMBER:
        return java.time.Month.DECEMBER;
      default:
        throw new IllegalArgumentException ("Unknown month " + eMonth);
    }
  }
96398
public Integer getMonth() {
		String dateValue = getValue();

		if (dateValue != null && dateValue.length() >= MONTH_END) {
			return parseDateComponent(dateValue.substring(MONTH_START, MONTH_END), getPaddingChar());
		} else {
			return null;
		}
	}
935134
public static int getMonthFromDate(Date date) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		return cal.get(Calendar.MONTH) + 1;
	}