unixtojd
把 Unix 时间戳转换为儒略日计数。
unixtojd
PHP 4及以上版本
将Unix时间戳转换为儒略日(Julian Day Number)。儒略日是从公元前4713年1月1日开始计算的连续天数,用于天文学和日期计算。
int unixtojd ( int $timestamp )
返回对应Unix时间戳的儒略日整数值。
<?php $timestamp = strtotime("2025-06-15 12:00:00"); $jd = unixtojd($timestamp); echo "2025年6月15日12点对应的儒略日是:".$jd; ?>
此示例首先通过 strtotime 将日期字符串转换为Unix时间戳,然后使用 unixtojd 函数将该时间戳转换为儒略日,最后打印出结果。