PHP 中的 unixtojd() 函数
phpprogrammingserver side programming更新于 2025/9/25 10:52:17
unixtojd() 函数将 Unix 时间戳转换为儒略日计数。它返回 Unix 时间戳对应的儒略日(自 1970 年 1 月 1 日以来的秒数),如果没有提供时间戳,则返回当前日期的儒略日。
语法
unixtojd(timestamp)
参数
timestamp − 需要转换的 Unix 时间戳。
返回
unixtojd() 函数返回 Unix 时间戳对应的儒略日(自 1970 年 1 月 1 日以来的秒数),如果没有提供时间戳,则返回当前日期的儒略日。
示例
下面是一个例子 −
<?php echo unixtojd(); ?>
输出
2458402

