I want to get the next rounded hour (10:00:00 instead of 10:25:01) by calling the strtotime
function. The output from strtotime
should translate directly to the rounded hour.
At the moment if I do
var_dump(date('Y-m-d H:i:s', strtotime('+1 hour')));
I get an unrounded value such as
string '2011-08-16 10:21:57' (length=19)
while I would like to get
string '2011-08-16 10:00:00' (length=19)
I know this can be achieved by doing:
var_dump(date('Y-m-d H:00:00', strtotime('+1 hour')));
But I'd like to achieve the same by using strtotime only. So I need a string that will evaluate to the rounded hour by strtotime.
I tried values such as
next hour, 0 minutes
+1 hour, 0 minutes
next rounded hour
but without success.