: This article describes how to calculate the difference between two timestamps in PHP. if you are interested in the PHP Tutorial, refer to it. Difference between two timestamps calculated by PHP
/*** Calculate 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/60); $ secs = $ remain % 60; $ 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) ;}) ;}; script
The preceding section describes the difference between two timestamps in PHP computing, including the related content. I hope my friends who are interested in the PHP Tutorial will be helpful.