3v4l.org

run code in 300+ PHP versions simultaneously
<?php $seconds_in_hour = 60 * 60; $seconds_in_day = $seconds_in_hour * 24; $epoch = time(); $current_hour = $epoch % $seconds_in_day / $seconds_in_hour; echo $current_hour; if ($current_hour > 12) { $time_prefix = "pm"; $current_hour -= 12; } else { $time_prefix = "am"; } echo $current_hour; echo $time_prefix; ?>

preferences:
37.58 ms | 402 KiB | 5 Q