标签:
//第一种方法
$time1 = mktime(10,20,30,2,5,2000); //2000-2-5 10:20:30
$time2 = mktime(18,30,20,5,2,2000); //2000-5-2 18:30:20
//第二种方法
$time1= ‘2010-7-1‘;
$time2=‘2010-7-8‘;
//计算两者差值
$days=abs((strtotime($date1)-strtotime($date2))/86400);
$diff = (int)(($time2-$time1)/(24*3600));
echo "$time2 和 $time1 的时间差为:" . $diff . "天
";
标签:
原文地址:http://www.cnblogs.com/pengboyu/p/4497162.html