cal_days_in_month

Return the number of days in a month for a given year and calendar

Syntax

cal_days_in_month(int $calendar, int $month, int $year): int

Parameters

calendar

Calendar to use for calculation

Number Constant Description
0 CAL_GREGORIAN Gregorian Calendar
1 CAL_JULIAN Julian Calendar
2 CAL_JEWISH Jewish Calendar
3 CAL_FRENCH French Revolutionary Calendar
month

Month in the selected calendar

year

Year in the selected calendar

Return

The length in days of the selected month in the given calendar

Examples

1 · calendar · CAL_GREGORIAN

<?

$calendar = CAL_GREGORIAN;
$month = 1;
$year = 1;

$return = cal_days_in_month($calendar, $month, $year);

echo $return;

?>
31

2 · calendar · CAL_JULIAN

<?

$calendar = CAL_JULIAN;
$month = 1;
$year = 1;

$return = cal_days_in_month($calendar, $month, $year);

echo $return;

?>
31

3 · calendar · CAL_JEWISH

<?

$calendar = CAL_JEWISH;
$month = 1;
$year = 1;

$return = cal_days_in_month($calendar, $month, $year);

echo $return;

?>
30

4 · calendar · CAL_FRENCH

<?

$calendar = CAL_FRENCH;
$month = 1;
$year = 1;

$return = cal_days_in_month($calendar, $month, $year);

echo $return;

?>
30

cal_from_jd

cal_info

cal_to_jd

easter_date

easter_days

frenchtojd

gregoriantojd

jddayofweek

jdmonthname

jdtofrench

jdtogregorian

jdtojewish

jdtojulian

jdtounix

jewishtojd

juliantojd

unixtojd

PHP

Home Menu