php倒计时时间计算:
$time1=strtotime("2015-11-15 16:33:00");
$time2=strtotime("now");
$sec=$time1-$time2;
$year=floor($sec/3600/24/365);//年
$temp=$sec-$year*365*24*3600;
$month=floor($temp/3600/24/30);//月
$temp=$temp-$month*30*24*3600;
$day=floor($temp/3600/24);//日
$temp=$temp-$day*3600*24;
$hour=floor($temp/3600);//小时
$temp=$temp-$hour*3600;
$minute=floor($temp/60);//分
$second=$temp-$minute*60;//秒
$nimei="距离儿童节还有".$year."年".$month."月".$day."天".$hour."小时".$minute."分".$second."秒";
if ("$year"=="0"){$nimei="距离儿童节还有".$month."月".$day."天".$hour."小时".$minute."分".$second."秒";}
elseif("$month"=="0"){$nimei="距离儿童节还有".$year."年".$day."天".$hour."小时".$minute."分".$second."秒";}
elseif("$day"=="0"){$nimei="距离儿童节还有".$year."年".$month."月".$hour."小时".$minute."分".$second."秒";}
elseif("$hour"=="0"){$nimei="距离儿童节还有".$year."年".$month."月".$day."天".$minute."分".$second."秒";}
elseif("$minute"=="0"){$nimei="距离儿童节还有".$year."年".$month."月".$day."天".$hour."小时".$second."秒";}
elseif("$second"=="0"){$nimei="距离儿童节还有".$year."年".$month."月".$day."天".$hour."小时".$minute."分";}
echo $nimei;//输出格式:距离儿童节还有1年6月18天15小时49分11秒
?>