3v4l.org

run code in 300+ PHP versions simultaneously
<?php //A timestamp indicates a fixed point in time, irregardless of timezone and daylight savings, so PHP must not change it when setting it: $x = new DateTime(); $x->setTimezone(new DateTimezone('America/Chicago')); $x->setTimestamp(1446357600); echo $x->format('c') . "\n"; $x->setTimestamp(1446361200); echo $x->format('c') . "\n"; //This should have a different offset since it's outside DST echo $x->getTimestamp(); //Simpler example $x = new DateTime(); $x->setTimezone(new DateTimezone('America/Chicago')); $x->setTimestamp(1446361200); echo $x->getTimestamp(); //Returns a different timestamp. No apparent way to specify a timestamp during the repeated hour.

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
215.95 ms | 2829 KiB | 8 Q