3v4l.org

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