两个时间差几天几小时

来源:互联网 发布:广告投放算法好处 编辑:程序博客网 时间:2024/04/28 05:16
$time1=strtotime("2014-6-15 00:00:00");$time2=strtotime("now");$sec=$time1-$time2;  if($sec < 0){$sec = -$sec;$datedis['0']="-";}else{$datedis['0']="+";}$year=floor($sec/3600/24/365);$temp=$sec-$year*365*24*3600;$day=floor($temp/3600/24);$temp=$temp-$day*3600*24;$hour=floor($temp/3600);$datedis['1']=$day;$datedis['2']=$hour;print_r($datedis);

0 0