3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input =0.58333333333334; $hour = intval(24*$input); Var_dump($hour); $fraction = $hour-floor($hour); Echo $hour . " " . $fraction; // Echo $hour .":". Str_replace(".",":",((24*$input)-$hour)*60);

preferences:
69.04 ms | 402 KiB | 5 Q