PHP calculates a difference of two timestamps
/** * Calculates the difference between two timestamps * @param $begin _time * @param $end _time * @return Array */ functiontimediff( $begin _time, $end _time ){if($begin _time<$end _time) {$starttime=$begin _time;$endtime=$end _time; }Else{$starttime=$end _time;$endtime=$begin _time; }$timediff=$endtime-$starttime;$days= Intval ($timediff/86400);$remain=$timediff%86400;$hours= Intval ($remain/3600);$remain=$remain%3600;$mins= Intval ($remain/ -);$secs=$remain% -;$res=Array("Day"=$days,"Hour"=$hours,"Min"=$mins,"SEC"=$secs); Log::info ($res);return$res; }
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the PHP two timestamp difference, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.