3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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'); } ?>
based on doiHV
Output for 7.0.20 - 7.2.0
Notice: Undefined variable: D in /in/SBGir on line 6 2015-12-01T08:57:42Z
Output for 7.0.6
Notice: Undefined variable: D in /in/SBGir on line 6 2016-05-03T17:52:05Z
Output for 7.0.5
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-03T06:11:59Z
Output for 7.0.4
Notice: Undefined variable: D in /in/SBGir on line 6 2016-03-10T19:06:17Z
Output for 7.0.3
Notice: Undefined variable: D in /in/SBGir on line 6 2016-03-18T20:27:20Z
Output for 7.0.2
Notice: Undefined variable: D in /in/SBGir on line 6 2016-03-23T02:41:07Z
Output for 7.0.1
Notice: Undefined variable: D in /in/SBGir on line 6 2016-03-24T05:58:04Z
Output for 7.0.0
Notice: Undefined variable: D in /in/SBGir on line 6 2016-03-27T06:52:33Z
Output for 5.6.21
Notice: Undefined variable: D in /in/SBGir on line 6 2016-05-02T13:00:12Z
Output for 5.6.20
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-10T05:13:11Z
Output for 5.6.19
Notice: Undefined variable: D in /in/SBGir on line 6 2016-03-08T03:18:54Z
Output for 5.6.18
Notice: Undefined variable: D in /in/SBGir on line 6 2016-03-15T12:08:51Z
Output for 5.6.17
Notice: Undefined variable: D in /in/SBGir on line 6 2016-03-19T23:44:02Z
Output for 5.6.16
Notice: Undefined variable: D in /in/SBGir on line 6 2016-03-28T07:41:41Z
Output for 5.6.15
Notice: Undefined variable: D in /in/SBGir on line 6 2016-03-29T08:31:13Z
Output for 5.6.14
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-02T10:21:22Z
Output for 5.6.13
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-15T14:52:39Z
Output for 5.6.12
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-20T05:19:24Z
Output for 5.6.11
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-24T11:44:15Z
Output for 5.6.10
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-25T13:48:02Z
Output for 5.6.9
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-27T18:56:25Z
Output for 5.6.8
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-30T03:45:20Z
Output for 5.5.35
Notice: Undefined variable: D in /in/SBGir on line 6 2016-05-22T21:57:56Z
Output for 5.5.34
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-11T07:24:34Z
Output for 5.5.33
Notice: Undefined variable: D in /in/SBGir on line 6 2016-03-09T06:11:35Z
Output for 5.5.32
Notice: Undefined variable: D in /in/SBGir on line 6 2016-03-17T16:00:23Z
Output for 5.5.31
Notice: Undefined variable: D in /in/SBGir on line 6 2016-03-21T02:49:30Z
Output for 5.5.30
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-01T10:24:08Z
Output for 5.5.29
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-17T05:10:49Z
Output for 5.5.28
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-21T08:35:15Z
Output for 5.5.27
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-22T10:18:00Z
Output for 5.5.26
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-26T16:28:38Z
Output for 5.5.25
Notice: Undefined variable: D in /in/SBGir on line 6 2016-04-28T23:52:11Z
Output for 5.5.24
Notice: Undefined variable: D in /in/SBGir on line 6 2016-05-24T06:03:15Z
Output for 5.4.45
Notice: Undefined variable: D in /in/SBGir on line 6 2015-12-01T08:57:45Z
Output for 5.4.44
Notice: Undefined variable: D in /in/SBGir on line 6 2015-12-01T08:57:46Z
Output for 5.4.42 - 5.4.43
Notice: Undefined variable: D in /in/SBGir on line 6 2015-12-01T08:57:47Z
Output for 5.4.40 - 5.4.41
Notice: Undefined variable: D in /in/SBGir on line 6 2015-12-01T08:57:48Z
Output for 5.4.38 - 5.4.39
Notice: Undefined variable: D in /in/SBGir on line 6 2015-12-01T08:57:49Z
Output for 5.4.35 - 5.4.37
Notice: Undefined variable: D in /in/SBGir on line 6 2015-12-01T08:57:50Z
Output for 5.3.29, 5.4.32 - 5.4.34
Notice: Undefined variable: D in /in/SBGir on line 6 2015-12-01T08:57:51Z
Output for 5.4.27 - 5.4.31
Notice: Undefined variable: D in /in/SBGir on line 6 2015-12-01T08:57:52Z
Output for 5.3.28, 5.4.23 - 5.4.26
Notice: Undefined variable: D in /in/SBGir on line 6 2015-12-01T08:57:53Z
Output for 5.4.19 - 5.4.22
Notice: Undefined variable: D in /in/SBGir on line 6 2015-12-01T08:57:54Z
Output for 5.3.24 - 5.3.27, 5.4.13 - 5.4.18
Notice: Undefined variable: D in /in/SBGir on line 6 2015-12-01T08:57:55Z
Output for 5.3.20 - 5.3.23, 5.4.10 - 5.4.12
Notice: Undefined variable: D in /in/SBGir on line 6 2015-12-01T08:57:56Z