I need to get timestamp with seconds set to 00. I do this like this:
$time = time();
$time = substr($time, 0, strlen($time) - 2) . '00';
But the result is still with seconds, for example:
How to remove seconds or set it to 00 ?
$time = time();
$time -= $time % 60;
A timestamp represents the number of seconds since 19xx somewhat. Setting the last 2 digits to zero does not build a DateTime with 00 seconds.
$time = new DateTime();
echo $time->format('Y-m-d H:i'), ':00';
This does.