Latest web development tutorials

PHP cal_from_jd () function

PHP Calendar Reference Manual PHP Calendar Reference Manual

Examples

Julian day count to a Gregorian calendar date:

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

Running instance »

Definition and Usage

cal_from_jd () function to convert a Julian day count for the specified calendar date.

grammar

cal_from_jd( jd,calendar);

参数 描述
jd 必需。一个数字(儒略日计数)。
calendar 必需。规定要使用的历法。可以使用下面这些常量:
  • CAL_GREGORIAN
  • CAL_JULIAN
  • CAL_JEWISH
  • CAL_FRENCH

technical details

return value: It returns an array containing the following calendar information:
  • Date, in the form "month / day / year"
  • month
  • year
  • The first few days of the week
  • Weekday and month abbreviation and full name
PHP version: 4.1+


PHP Calendar Reference Manual PHP Calendar Reference Manual