<?php function roundTime($time, $interval){ $seconds = $time; $rounded_seconds = round($seconds / ($interval * 60)) * ($interval * 60); return date('H:i', $rounded_seconds) . "\n"; } echo roundTime(strtotime("2023-05-30 14:40"), 15); echo PHP_EOL; echo roundTime(strtotime("2023-05-30 14:40"), 30);
You have javascript disabled. You will not be able to edit any code.