3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set("Europe/Paris"); $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.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 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

preferences:
149.75 ms | 404 KiB | 182 Q