PHP cal_from_jd()Functions

PHP Calendar 参考手册PHP Calendar Reference Manual

Examples

Convert a Julian day count to a Gregorian date:

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

Run example »

Definition and Usage

The cal_from_jd() function converts a Julian day count to a date in a specified calendar.

Syntax

cal_from_jd(jd,calendar);

Parameters Description
jd Required. A number (Julian day count).
calendar Required. Specifies the calendar to use. The following constants can be used:
  • CAL_GREGORIAN
  • CAL_JULIAN
  • CAL_JEWISH
  • CAL_FRENCH

Technical Details

Return value: Returns an array containing the following calendar information:
  • Date, in the form "month/day/year"
  • month
  • year
  • Day of the week
  • Abbreviations and full names of weekdays and months
PHP Version: 4.1+


PHP Calendar 参考手册PHP Calendar Reference Manual Other Extensions