3v4l.org

run code in 300+ PHP versions simultaneously
<?php $checkDateTimeUTC = ""; $D = '20130412'; $T = '110101'; if (($D > "") and ($T > "")) { //D=20130412&T=110101 $datum = gmdate("Y-m-d"); //YYYYMMDD UTC $tijd = gmdate("H:i:s"); //hhmmss UTC $time_string = substr($D, 0, 4) . "-" . substr($D, 4, 2) . "-" . substr($D, 6, 2) . " " . substr($T, 0, 2) . ":" . substr($T, 2, 2) . ":" . substr($T, 4, 2); echo $time_string; echo "\r\n"; echo $checkDateTimeUTC = gmdate('Y-m-d\TH:i:s\Z', strtotime($time_string)); } else { echo $checkDateTimeUTC = gmdate('Y-m-d\TH:i:s\Z'); } ?>
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
2013-04-12 11:01:01 2013-04-12T09:01:01Z
Output for 7.3.32 - 7.3.33, 8.0.13
2013-04-12 11:01:01 2013-04-12T11:01:01Z

preferences:
240.14 ms | 401 KiB | 322 Q