class timeDiffer{
function getTimeDiffer($startdate){
$enddate=date('Y-m-d H:i:s',time());
$date=floor((strtotime($enddate)-strtotime($startdate))/86400);
$hour=floor(((strtotime($enddate)-strtotime($startdate))%86400)/3600%24);
$minute=floor(((strtotime($enddate)-strtotime($startdate))%86400)/60%60);
$second=floor((strtotime($enddate)-strtotime($startdate))%86400%60);
$differTime = "";
if((!empty($date))||$date!=null||$date!=0){
$differTime =$differTime.$date."天";
}
if((!empty($hour))||$hour!=null||$hour!=0){
$differTime =$differTime.$hour."小时";
}
if((!empty($minute))||$minute!=null||$minute!=0){
$differTime =$differTime.$minute."分钟";
}
if((!empty($second))||$second!=null||$second!=0){
$differTime =$differTime.$second."分钟";
}
// echo $date."天
";
// echo $hour."小时
";
// echo $minute."分钟
";
// echo $second."秒
";
return $differTime;
}
}
?>