1. [代码][PHP]代码
<?php
//Get detail gap of year,month and days between two different time by vfhky 20130728
$common = (time()-strtotime(get_option('swt_builddate')));
$a = floor($common/86400/360); //整数年
$b = floor($common/86400/30) - $a*12; //整数月
$c = floor($common/86400) - $a*360 - $b*30; //整数日
$d = floor($common/86400); //总的天数
echo $a."年".$b."月".$c."日(共计".$d."天)";
?>
立即学习“PHP免费学习笔记(深入)”;
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号