[Solved] Nearest next even hour


To accomplish your goal, you could add the missing time to your DateTime object:

$dt = new DateTime('2014-11-08 22:05:00');
$sec = $dt->format('G') * 3600 + $dt->format('i') * 60 + $dt->format('s');
$sec %= 7200;
$dt->modify("-$sec second")->modify('+2 hour');
echo $dt->format('c');

demo

Be careful about DST.

solved Nearest next even hour