I need a code what detect the current time and give me the following time what is divisible by five.
For example: It's: 06 03, 2017 21:22:23 , give me 06 03, 2017 21:25:00 in php. I have no any idea to starting. Is there any code or solution to do this?
$now = time();
// Add five minutes in seconds, round it down to the nearest five:
$next = ceil($now/300)*300;
echo date('H:i', $next);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With