PHP Tutorial - PHP cal_from_jd() Function






Definition

The cal_from_jd() function converts a Julian day count into a date of a specified calendar.

Syntax

PHP cal_from_jd() Function has the following syntax.

cal_from_jd(jd,calendar);

Parameter

ParameterIs RequiredDescription
jdRequired.Julian Day as an integer
calendarRequired.Calendar to convert to.

Calendar must be one of the following values:

  • CAL_GREGORIAN
  • CAL_JULIAN
  • CAL_JEWISH
  • CAL_FRENCH




Return

PHP cal_from_jd() Function returns an array that contains calendar information.

Example

Converts a Julian day count into a date of a specified calendar


<?php
$d=unixtojd(mktime(0,0,0,6,20,2013));
print_r(cal_from_jd($d,CAL_GREGORIAN));
?>

The code above generates the following result.