PHP 5.6.31 Released

Voting

Please answer this simple SPAM challenge: max(one, seven)?
(Example: nine)

The Note You're Voting On

feha at vision dot to
6 years ago
Here is a short neat function to round minutes (hour) ...

<?php

function minutes_round ($hour = '14:03:32', $minutes = '5', $format = "H:i")
{
   
// by Femi Hasani [www.vision.to]
   
$seconds = strtotime($hour);
   
$rounded = round($seconds / ($minutes * 60)) * ($minutes * 60);
    return
date($format, $rounded);
}

?>

You decide to round to nearest minute ...
example will produce : 14:05

<< Back to user notes page

To Top