Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

cal_to_jd

Description

The cal_to_jd of Calendar for PHP 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

ValueConstantDescription
0CAL_GREGORIANGregorian Calendar
1CAL_JULIANJulian Calendar
2CAL_JEWISHJewish Calendar
3CAL_FRENCHFrench 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

Returns the 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
HomeMenu