Provided with a day, month, year, hour and minute in the specific
calendar type convert it into the equivalent Unix Time Stamp.

@param int $year
@param int $month
@param int $day
@param int $hour
@param int $minute
@return int timestamp
508184
public function convert_to_timestamp($year, $month, $day, $hour = 0, $minute = 0) {
        $gregorianinfo = $this->convert_to_gregorian($year, $month, $day, $hour, $minute);
        return make_timestamp(
            $gregorianinfo['year'],
            $gregorianinfo['month'],
            $gregorianinfo['day'],
            $gregorianinfo['hour'],
            $gregorianinfo['minute'],
            0);
    }
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];
    }
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;
    }
897903
public function setDate($year, $month, $day)
    {
        return parent::setDate(self::$yearMustAlwaysBe, self::$monthMustAlwaysBe, self::$dayMustAlwaysBe);
    }
620006
public function setDate($year, $month, $day) : \DateTime /*self invariant*/
    {
        if ($this->frozen) {
            throw new \RuntimeException(get_class($this) . ' is read-only, frozen.');
        }
        return parent::setDate($year, $month, $day);
    }
314341
public function setDate($year, $month, $day)
    {
        if (self::$_immutable) {
            self::$_immutable = false;
            $newDate = clone $this;
            $newDate->setDate($year, $month, $day);
            self::$_immutable = true;

            return $newDate;
        } else {
            return parent::setDate($year, $month, $day);
        }
    }
1314220
public static function isValideDate($year, $month, $day) {
        $dayLastMonthJalali = static::isLeapYear($year) && ($month == 12) ? 30 : static::$daysMonthJalali[intval($month)-1];
        return $year >= 1 && $year <= 32766
        && $month >= 1 && $month <= 12
        && $day >= 1 && $day <= $dayLastMonthJalali;
    }
1324314
private function validateDate(int $year, int $month, int $day): bool
    {
        if (!$this->validateMonth($month)) {
            return false;
        }
        if (!$this->validateDay($day)) {
            return false;
        }
        if (!\checkdate($month, $day, $year)) {
            return false;
        }
        return true;
    }
435577
protected function islamicToJd($year, $month, $day)
    {
        $jd = (int)((11 * $year + 3) / 30) + (int)(354 * $year) + (int)(30 * $month) 
            - (int)(($month - 1) / 2) + $day + 1948440 - 385;
        return $jd;
    }
848829
protected function daysYear($month, $day) {
        $days = 0;
        for ($i = 1; $i < $month; $i ++) {
            $days += static::$daysMonthJalali[$i];
        }
        return ($days + $day);
    }
22557
private static function calDaysInMonthCalendar(CalendarInterface $calendar, $year, $month)
    {
        try {
            return $calendar->daysInMonth($year, $month);
        } catch (InvalidArgumentException $ex) {
            $error_msg = PHP_VERSION_ID < 70200 ? 'invalid date.' : 'invalid date';

            return trigger_error($error_msg, E_USER_WARNING);
        }
    }
1009541
public static function checkBirthDate($day, $month, $year) {
        if (empty($day) || empty($month) || empty($year))
            return false;

        return checkdate($month, $day, $year);
    }
1088678
public function daysInMonth($year, $month)
    {
        if ($year === 0) {
            throw new InvalidArgumentException('Year ' . $year . ' is invalid for this calendar');
        } elseif ($month < 1 || $month > 12) {
            throw new InvalidArgumentException('Month ' . $month . ' is invalid for this calendar');
        } elseif ($month === 1 || $month === 3 || $month === 5 || $month === 7 || $month === 8 || $month === 10 || $month === 12) {
            return 31;
        } elseif ($month === 4 || $month === 6 || $month === 9 || $month === 11) {
            return 30;
        } elseif ($this->isLeapYear($year)) {
            return 29;
        } else {
            return 28;
        }
    }
143257
public static function create($year, $month, $day, $hour, $minute, $second)
    {
        return new static($year, $month, $day, $hour, $minute, $second);
    }
819670
public function monthly($month = '*', $day = 1, $hour = 0, $minute = 0)
    {
        if (\is_string($hour)) {
            $parts = explode(':', $hour);
            $hour = $parts[0];
            $minute = $parts[1] ?? '0';
        }
        $c = $this->validateCronSequence($minute, $hour, $day, $month);

        return $this->at("{$c['minute']} {$c['hour']} {$c['day']} {$c['month']} *");
    }
1205216
public function daysInMonth($year, $month)
    {
        if ($year < 1) {
            throw new InvalidArgumentException('Year ' . $year . ' is invalid for this calendar');
        } elseif ($month < 1 || $month > 13) {
            throw new InvalidArgumentException('Month ' . $month . ' is invalid for this calendar');
        } elseif ($month == 2) {
            return $this->daysInMonthHeshvan($year);
        } elseif ($month == 3) {
            return $this->daysInMonthKislev($year);
        } elseif ($month == 6) {
            return $this->daysInMonthAdarI($year);
        } else {
            return self::$FIXED_MONTH_LENGTHS[$month];
        }
    }
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;

	}