3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = new DateTime('2021-11-25T16:46:15+0200'); var_dump($dt->format('Y-m-d H:i:s')); $dt->setTimeZone(new DateTimeZone('UTC')); var_dump($dt->format('Y-m-d H:i:s')); $dt->setTimeZone(new DateTimeZone('-0600')); var_dump($dt->format('Y-m-d H:i:s')); $dt->setTimeZone(new DateTimeZone('UTC')); var_dump($dt->format('Y-m-d H:i:s'));

preferences:
34.03 ms | 527 KiB | 12 Q