Interval between date_diff calculation & quot; operation time & quot; and & quot; current time & quot;
Function get_Pass_Date ($ ymdhms1, $ ymdhms2) {$ datetime1 = date_create ("$ hour"); $ datetime2 = date_create ("$ ymdhms2"); $ interval = date_diff ($ datetime1, $ datetime2); $ psdate = null; if ($ interval-> y> 0) {$ psdate = $ interval-> format ('% y year % m month % d Day % h hour % I minute % S ');} else if ($ interval-> m> 0) {$ psdate = $ interval-> format ('% m month % d Day % h hour % I minute % S ');} else if ($ interval-> d> 0) {$ psdate = $ interval-> format ('% d day % h hour % I minute % s second ');} else if ($ interval-> h> 0) {$ psdate = $ interval-> format ('% h % I % s s ');} else if ($ interval-> I> 0) {$ psdate = $ interval-> format ('% I % S ');} else {$ psdate = $ interval-> format ('% s second');} return $ psdate ;}