3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $star = '2014-11-02 01:01:01'; $finish = '2014-11-02 03:02:01'; $s = strtotime($star); $f = strtotime($finish); $e = $f-$s; echo sec2date($e); function sec2date($secs) { $sec = $secs%60; $jam = intval($secs/3600); $menit = intval($secs/60)%60; $sec = ($sec < 10)?"0$sec":"$sec"; $jam = ($jam < 10)?"0$jam":"$jam"; $menit = ($menit < 10) ? "0$menit" : "$menit"; return "$jam:$menit:$sec"; }
based on 9BTR5
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
02:01:00
Output for hhvm-3.10.0

Process exited with code 153.