PHP cal_from_jd() 函数
PHP Calendar 函数
定义和用法
cal_from_jd() 函数把儒略日计数转换为指定历法的日期。
语法
cal_from_jd(jd,calendar)
参数 | 描述 |
---|---|
jd | 必需。一个数字(儒略日计数)。 |
calendar |
必需。规定要使用的历法。可以使用下面这些常量:
|
例子
<?php
$d=unixtojd(mktime(0,0,0,1,18,2006));
print_r(cal_from_jd($d,CAL_GREGORIAN));
?>
$d=unixtojd(mktime(0,0,0,1,18,2006));
print_r(cal_from_jd($d,CAL_GREGORIAN));
?>
输出:
Array
(
[date] => 1/18/2006
[month] => 1
[day] => 18
[year] => 2006
[dow] => 3
[abbrevdayname] => Wed
[dayname] => Wednesday
[abbrevmonth] => Jan
[monthname] => January
)
(
[date] => 1/18/2006
[month] => 1
[day] => 18
[year] => 2006
[dow] => 3
[abbrevdayname] => Wed
[dayname] => Wednesday
[abbrevmonth] => Jan
[monthname] => January
)
PHP Calendar 函数