Gets the days of the defined month in defined year.

@param  integer $year
@param  integer $month
@return integer
424128
public static function GetDaysInMonth( int $year, int $month ) : int
   {

      $dt = new \DateTime();
      $dt->setDate( $year, $month, 2 );
      $dt->setTime( 0, 0, 2 );

      return \intval( $dt->format( 't' ) );

   }
475428
int getDaysInYearMonth(int year, int month) {
        if (month == 12 && isLeapYear(year)) {
            return LONG_MONTH_LENGTH;
        }
        return (--month % 2 == 0 ? LONG_MONTH_LENGTH : SHORT_MONTH_LENGTH);
    }
1369263
public static function daysInMonth(int $month, int $year = null)
    {
        // Redefine vars
        $year   = ! empty($year) ? $year : (int) date('Y');

        if ($month < 1 or $month > 12) {
            return false;
        } elseif ($month == 2) {
            if ($year % 400 == 0 or ($year % 4 == 0 and $year % 100 != 0)) {
                return 29;
            }
        }

        $days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

        return $days_in_month[$month-1];
    }
142320
public function ymdToJd($year, $month, $day)
    {
        if ($month < 1 || $month > $this->monthsInYear()) {
            throw new InvalidArgumentException('Month ' . $month . ' is invalid for this calendar');
        }

        if ($year < 0) {
            // 1 BCE is 0, 2 BCE is -1, etc.
            ++$year;
        }
        $a     = (int) ((14 - $month) / 12);
        $year  = $year + 4800 - $a;
        $month = $month + 12 * $a - 3;

        return $day + (int) ((153 * $month + 2) / 5) + 365 * $year + (int) ($year / 4) - (int) ($year / 100) + (int) ($year / 400) - 32045;
    }
1047889
public function convertGregorianToJd($year, $month, $day)
    {
        // Special case mapping 0/0/0 -> 0
        if ($year == 0 || $month == 0 || $day == 0) {
            return 0;
        }

        $m1412 = ($month <= 2) ? - 1 : 0;
        return floor((1461 * ($year + 4800 + $m1412)) / 4) + floor((367 * ($month - 2 - 12 * $m1412)) / 12) -
             floor((3 * floor(($year + 4900 + $m1412) / 100)) / 4) + $day - 32075;
    }
943951
public function set(int $day, int $month, int $year)
    {
        $validator = new DateValidator($day, $month, $year);

        if (!$validator->isValid()) {
            throw new InvalidDateException();
        }

        $this->day = $day;
        $this->month = $month;
        $this->year = $year;

        $this->jdn = (int) static::process($day, $month, $year);

        return $this;
    }
37281
public static function DaysInYear(int $year)
    {
        $period_from_carbon = \Phunc\Year::FirstDayInYearCarbon($year);
        $days_in_year = 365 + $period_from_carbon->format('L');
        return $days_in_year;
    }
1109594
function lastday ($month,$day,$year)

	{

		$lastdayen=date("d",mktime(0,0,0,$month+1,0,$year));

		list( $jyear, $jmonth, $jday ) = $this->gregorian_to_jalali($year, $month, $day);

		$lastdatep=$jday;

		$jday=$jday2;

		while($jday2!="1")

		{

			if($day<$lastdayen)

			{

				$day++;

				list( $jyear, $jmonth, $jday2 ) = $this->gregorian_to_jalali($year, $month, $day);

				if($pdate2=="1") break;

				if($pdate2!="1") $lastdatep++;

			}

			else

			{

				$day=0;

				$month++;

				if($month==13)

				{

					$month="1";

					$year++;

				}

			}



		}

		return $lastdatep-1;

	}
631335
protected static function getDayOfYear($day, $month) {
        
        $dayOfYear = $day;
        if ($month > 6) {
            $dayOfYear += (186 + (($month - 6 - 1) * 30));
        } else {
            $dayOfYear += (($month - 1) * 31);
        }
        
        return $dayOfYear;
    }
1033771
public static function of(int $month, int $day) : MonthDay
    {
        Field\MonthOfYear::check($month);
        Field\DayOfMonth::check($day, $month);

        return new MonthDay($month, $day);
    }
313184
public static function hijriToJulian(int $year, int $month, int $day)
    {
        return floor((11 * $year + 3) / 30) + floor(354 * $year) + floor(30 * $month)
            - floor(($month - 1) / 2) + $day + 1948440 - 386;
    }
1009541
public static function checkBirthDate($day, $month, $year) {
        if (empty($day) || empty($month) || empty($year))
            return false;

        return checkdate($month, $day, $year);
    }
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();
	}
1111941
public function setDate($year, $month, $day)
    {
        if($this->_date->setDate($year, $month, $day) === false) {
            return false;
        }

        return $this;
    }
120758
private static int getDayOfMonth(int dayOfYear, int month, int year) {

        Integer[] newMonths = getAdjustedMonthDays(year);

        if (dayOfYear >= 0) {
            if (month > 0) {
                return dayOfYear - newMonths[month].intValue();
            } else {
                return dayOfYear;
            }
        } else {
            dayOfYear = (isLeapYear(year) ? (dayOfYear + 355)
                    : (dayOfYear + 354));
            if (month > 0) {
                return dayOfYear - newMonths[month].intValue();
            } else {
                return dayOfYear;
            }
        }
    }
757422
public static function createFromMonth($year, $month)
	    {
	        $year  = self::validateYear($year);
	        $month = self::validateRange($month, 1, 12);

	        return self::createFromDuration($year.'-'.sprintf('%02s', $month).'-01', '1 MONTH');
	    }
512058
def daysInMonth(self, month, year):
        
        result = None
        debug and log.debug('daysInMonth(%s, %s)', month, year)
        if month > 0 and month <= 12:
            result = self._DaysInMonthList[month - 1]

            if month == 2:
                if year in self._leapYears:
                    result += 1
                else:
                    if calendar.isleap(year):
                        self._leapYears.append(year)
                        result += 1

        return result