3v4l.org

run code in 500+ PHP versions simultaneously
<?php $dti2 = \DateTimeImmutable::createFromFormat('!Y-m-d', '2023-12-31', new \DateTimeZone('UTC')); echo "{$dti2->format(\DateTimeInterface::ATOM)}\n";
Output for 8.1.32 - 8.1.34, 8.2.0 - 8.2.31, 8.3.0 - 8.3.31, 8.4.1 - 8.4.22, 8.5.0 - 8.5.7
2023-12-31T00:00:00+00:00

preferences:
56.65 ms | 868 KiB | 4 Q