标签:分享 diff datetime color .com logs 间隔 ima div
PHP 计算两个日期间隔天数,可以使用date_diff( )函数:
<?php
$datetime1 = date_create(‘2009-10-11‘);
$datetime2 = date_create(‘2009-10-13‘);
$interval = date_diff($datetime1, $datetime2);
echo $interval->format(‘%R%a days‘);
?>
浏览器输出结果:
标签:分享 diff datetime color .com logs 间隔 ima div
原文地址:http://www.cnblogs.com/yongzhenye/p/7827461.html