PHP cal_from_jd() Function

Example

Convert the Julian Day count to the Gregorian calendar date:

<?php
$d=unixtojd(mktime(0,0,0,9,25,2016));
print_r(cal_from_jd($d,CAL_GREGORIAN));
?>

Running Example

Definition and Usage

The cal_from_jd() function converts the Julian Day count to the date of the specified calendar.

Syntax

cal_from_jd(jd,calendar);
Parameters Description
jd Required. Specifies the Julian Day as an integer.
calendar Required. Specifies the calendar to be converted to. It must be one of the following values:
  • CAL_GREGORIAN
  • CAL_JULIAN
  • CAL_JEWISH
  • CAL_FRENCH

Technical Details

Return value:

Returns an array containing the following calendar information:

  • Date, in the form of "month/day/year"
  • Month
  • Year
  • The day of the week
  • Abbreviations and full names of weekdays and months
PHP Version: 4.1+