3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Warsaw'); $timezoneShift = (2 * 60 * 60); //+2000 $timestamp = time(); $threeHours = (3 * 60 * 60); //3 hours interval $timezone -= $timezoneShift; $timestamp += $threeHours; $reminder = $timestamp % $threeHours; $timestamp -= $reminder; $timestamp += $timezoneShift; echo date('Y-m-d H:i:s', time()); echo date('Y-m-d H:i:s', $timestamp);

preferences:
27.73 ms | 402 KiB | 5 Q