3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dateTime = new DateTime(); $midnight = new DateTimeImmutable($dateTime->format('Ymd'), $dateTime->getTimezone()); var_dump($dateTime->format(DATE_ISO8601)); var_dump($dateTime->getTimezone()); var_dump($midnight->format(DATE_ISO8601)); var_dump($midnight->getTimezone());
Output for 5.6.28, 7.0.14 - 7.1.0
string(24) "2014-10-26T22:42:17+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2014-10-26T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
string(24) "2016-05-03T19:37:56+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-05-03T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.5
string(24) "2016-04-03T07:58:37+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-03T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
string(24) "2016-03-10T19:51:28+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-03-10T00:00:00+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.3
string(24) "2016-03-18T21:10:31+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-03-18T00:00:00+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.2
string(24) "2016-03-23T03:19:24+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-03-23T00:00:00+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.1
string(24) "2016-03-24T06:43:46+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-03-24T00:00:00+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.0
string(24) "2016-03-27T08:38:55+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-03-27T00:00:00+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
string(24) "2016-05-02T14:46:08+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-05-02T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
string(24) "2016-04-10T06:59:18+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-10T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.19
string(24) "2016-03-08T04:03:57+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-03-08T00:00:00+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.18
string(24) "2016-03-15T12:54:36+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-03-15T00:00:00+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.17
string(24) "2016-03-20T00:28:08+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-03-20T00:00:00+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.16
string(24) "2016-03-28T09:27:47+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-03-28T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.15
string(24) "2016-03-29T10:17:30+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-03-29T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.14
string(24) "2016-04-02T12:08:11+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-02T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.13
string(24) "2016-04-15T16:38:03+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-15T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.12
string(24) "2016-04-20T07:05:10+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-20T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
string(24) "2016-04-24T13:29:26+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-24T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.10
string(24) "2016-04-25T15:32:39+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-25T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
string(24) "2016-04-27T20:41:40+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-27T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.8
string(24) "2016-04-30T05:31:28+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-30T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
string(24) "2016-05-22T23:11:55+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-05-22T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
string(24) "2016-04-11T09:10:49+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-11T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.33
string(24) "2016-03-09T06:54:43+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-03-09T00:00:00+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32
string(24) "2016-03-17T16:43:48+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-03-17T00:00:00+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.31
string(24) "2016-03-21T03:33:30+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-03-21T00:00:00+0100" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30
string(24) "2016-04-01T12:10:29+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-01T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.29
string(24) "2016-04-17T06:56:28+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-17T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
string(24) "2016-04-21T10:20:29+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-21T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.27
string(24) "2016-04-22T12:03:40+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-22T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.26
string(24) "2016-04-26T18:14:06+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-26T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.25
string(24) "2016-04-29T01:36:40+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-04-29T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
string(24) "2016-05-24T07:49:12+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(24) "2016-05-24T00:00:00+0200" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.2.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/L09TQ on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/L09TQ on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/L09TQ on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/L09TQ on line 3