您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP获取两个时间相差的年数、月数和天数

2025/6/10 10:58:27发布13次查看
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."天)"; ?>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product