计算两个时间相差的天,时,分,秒
2012-05-17 16:24:42 来源:WEB开发网核心提示:php;">$d = "2012-05-22 15:30:10";function shi_jian_cha($d,$d1){ $time = strtotime($d) - strtotime($d1); $n_time = str_pad(floor($time/3
php;"> $d = "2012-05-22 15:30:10"; function shi_jian_cha($d,$d1) { $time = strtotime($d) - strtotime($d1); $n_time = str_pad(floor($time/3600/24),2,0,STR_PAD_LEFT )."天".str_pad(floor($time%(24*3600)/3600),2,0,STR_PAD_LEFT )."小时".str_pad(floor($time%3600/60),2,0,STR_PAD_LEFT)."分".str_pad($time%3600%60, 2, 0, STR_PAD_LEFT)."秒"; return $n_time; }
更多精彩
赞助商链接