cal_to_jd

Converts from a supported calendar to Julian Day Count

Syntax

cal_to_jd(int $calendar, int $month, int $day, int $year) : int

Parameters

calendar

Calendar to convert from

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

The month as a number, the valid range depends on the calendar

day

The day as a number, the valid range depends on the calendar

year

The year as a number, the valid range depends on the calendar

Return

A Julian Day number.

Examples

1 · calendar · CAL_GREGORIAN

<?

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

$return = cal_to_jd($calendar, $month, $day, $year);

echo $return;

?>
1721426

2 · calendar · CAL_JULIAN

<?

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

$return = cal_to_jd($calendar, $month, $day, $year);

echo $return;

?>
1721424

3 · calendar · CAL_JEWISH

<?

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

$return = cal_to_jd($calendar, $month, $day, $year);

echo $return;

?>
347998

4 · calendar · CAL_FRENCH

<?

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

$return = cal_to_jd($calendar, $month, $day, $year);

echo $return;

?>
2375840

cal_days_in_month

cal_from_jd

cal_info

easter_date

easter_days

frenchtojd

gregoriantojd

jddayofweek

jdmonthname

jdtofrench

jdtogregorian

jdtojewish

jdtojulian

jdtounix

jewishtojd

juliantojd

unixtojd

PHP

Home Menu