3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $to = DateTime::createFromFormat(DateTime::ISO8601, '2013-10-05T14:48:00.000Z'); $from = DateTime::createFromFormat(DateTime::ISO8601, '2013-03-26T09:01:22.104Z'); $a = new DateTime(); $a->createFromFormat(\DateTime::ISO8601,'2013-03-26T09:01:22.104Z'); echo $a->format(\DateTime::ISO8601); var_dump($a);
Output for 7.1.0
2013-10-18T15:11:58+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2013-10-18 15:11:58.004992" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28, 7.0.12 - 7.0.14
2013-10-18T15:11:58+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2013-10-18 15:11:58.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
2016-05-02T23:45:09+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-02 23:45:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.5
2016-04-02T13:20:54+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-02 13:20:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
2016-03-09T22:13:11+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-09 22:13:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.3
2016-03-17T22:36:16+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-17 22:36:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.2
2016-03-21T09:20:43+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-21 09:20:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.1
2016-03-23T08:58:52+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-23 08:58:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.0
2016-03-26T12:09:58+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-26 12:09:58.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
2016-05-01T18:51:16+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-01 18:51:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
2016-04-09T08:37:53+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-09 08:37:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.19
2016-03-06T19:22:21+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-06 19:22:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.18
2016-03-14T07:35:17+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-14 07:35:17.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.17
2016-03-19T03:12:46+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-19 03:12:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.16
2016-03-27T13:52:19+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-27 13:52:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.15
2016-03-28T14:44:58+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-28 14:44:58.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.14
2016-04-01T17:35:14+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-01 17:35:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.13
2016-04-14T21:32:06+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 21:32:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.12
2016-04-19T10:32:43+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-19 10:32:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
2016-04-22T17:53:09+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-22 17:53:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.10
2016-04-24T19:30:48+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-24 19:30:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
2016-04-27T00:28:10+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-27 00:28:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.8
2016-04-29T08:08:56+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-29 08:08:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.7
2016-05-24T17:39:33+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-24 17:39:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
2016-05-21T22:00:48+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-21 22:00:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
2016-04-10T14:04:14+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-10 14:04:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.33
2016-03-08T09:19:58+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-08 09:19:58.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32
2016-03-15T18:22:15+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-15 18:22:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.31
2016-03-20T06:07:07+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-20 06:07:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30
2016-03-31T16:55:40+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 16:55:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.29
2016-04-16T11:30:21+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-16 11:30:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
2016-04-20T13:38:45+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-20 13:38:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.27
2016-04-21T16:24:02+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-21 16:24:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.26
2016-04-25T21:44:14+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-25 21:44:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.25
2016-04-28T03:49:36+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-28 03:49:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
2016-04-30T11:32:33+0200object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 11:32:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.45
2016-02-19T14:28:25+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-02-19 14:28:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.44
2016-02-19T14:28:26+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-02-19 14:28:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.41 - 5.4.43
2016-02-19T14:28:27+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-02-19 14:28:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.40
2016-02-19T14:28:28+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-02-19 14:28:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.37 - 5.4.39
2016-02-19T14:28:29+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-02-19 14:28:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.35 - 5.4.36
2016-02-19T14:28:30+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-02-19 14:28:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.34
2016-02-19T14:28:31+0100object(DateTime)#1 (3) { ["date"]=> string(26) "2016-02-19 14:28:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.32
2016-02-19T14:28:31+0100object(DateTime)#3 (3) { ["date"]=> string(26) "2016-02-19 14:28:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30 - 5.4.31
2016-02-19T14:28:32+0100object(DateTime)#3 (3) { ["date"]=> string(26) "2016-02-19 14:28:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.29, 5.4.29
2016-02-19T14:28:32+0100object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-19 14:28:32" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.26 - 5.4.28
2016-02-19T14:28:33+0100object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-19 14:28:33" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.28, 5.4.23 - 5.4.25
2016-02-19T14:28:34+0100object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-19 14:28:34" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.20 - 5.4.22
2016-02-19T14:28:35+0100object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-19 14:28:35" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.27, 5.4.16 - 5.4.19
2016-02-19T14:28:36+0100object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-19 14:28:36" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.23 - 5.3.26, 5.4.13 - 5.4.15
2016-02-19T14:28:37+0100object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-19 14:28:37" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.19 - 5.3.22, 5.4.9 - 5.4.12
2016-02-19T14:28:38+0100object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-19 14:28:38" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.15 - 5.3.18, 5.4.6 - 5.4.8
2016-02-19T14:28:39+0100object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-19 14:28:39" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.12 - 5.3.14, 5.4.2 - 5.4.5
2016-02-19T14:28:40+0100object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-19 14:28:40" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.7 - 5.3.11, 5.4.0 - 5.4.1
2016-02-19T14:28:41+0100object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-19 14:28:41" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.3 - 5.3.6
2016-02-19T14:28:42+0100object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-19 14:28:42" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0 - 5.3.2
2016-02-19T14:28:43+0100object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-19 14:28:43" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.2.10 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CQM2G on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CQM2G on line 6 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/CQM2G on line 2
Process exited with code 255.
Output for 5.2.0 - 5.2.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CQM2G on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CQM2G on line 6 Fatal error: Call to undefined method DateTime::createfromformat() in /in/CQM2G on line 2
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CQM2G on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CQM2G on line 6 Fatal error: Class 'DateTime' not found in /in/CQM2G on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ',', expecting '(' in /in/CQM2G on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected ',', expecting '(' in /in/CQM2G on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/CQM2G on line 2
Process exited with code 255.