w3resource
PHP Tutorial

PHP: cal_to_jd() function

Description

The cal_to_jd() function calculates the Julian day count for a date in the specified calendar.

Version

(PHP 4 and above)

Syntax

cal_to_jd (calendar, month, day, year) 

Parameters

Name Description Required /
Optional
Type
calendar Supported calendar/values. CAL_GREGORIAN
CAL_JULIAN
CAL_JEWISH
CAL_FRENCH.
Required Integer
month The given month.
The valid range depends on the specified calendar.
Required Integer
day The given day.
The valid range depends on the specified calendar.
Required Integer
year The given year.
The valid range depends on the specified calendar.
Required Integer

Return value:

A Julian Day number.

Value Type: Integer.

Example:

<?php
$cal_date = cal_to_jd(CAL_GREGORIAN,11,04,2006);
echo($cal_date);
?>

Output:

2454044 

View the example in the browser

See also

PHP Function Reference



New Content: Composer: Dependency manager for PHP, R Programming