3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function Number2Date($number) { $seconds = '00'; $minutes = '00'; $hours = '00'; if(strpos('.', $number)) { $arr = explode(".", $number); $hours = $arr[0]; $minutes = round(60 * $arr[1]); } else { $hours = $number; } return $hours.":".$minutes.":".$seconds; } echo Number2Date(48.5); ?>
Output for 4.3.0 - 7.2.0
48.5:00:00