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.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions