3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateTime = new DateTime("now", new DateTimeZone('Europe/Warsaw')); echo $dateTime->format("Y-m-d H:i:s"); $dateTimeZone = new DateTimeZone('GMT'); $dateTime->setTimezone($dateTimeZone); echo $dateTime->format("Y-m-d H:i:s");
Output for 5.6.28, 7.0.14 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 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
2014-05-29 23:49:142014-05-29 21:49:14
Output for 7.0.6
2016-05-03 08:11:072016-05-03 06:11:07
Output for 7.0.5
2016-04-02 21:08:022016-04-02 19:08:02
Output for 7.0.4
2016-03-10 07:24:562016-03-10 06:24:56
Output for 7.0.3
2016-03-18 07:57:322016-03-18 06:57:32
Output for 7.0.2
2016-03-22 13:43:012016-03-22 12:43:01
Output for 7.0.1
2016-03-23 18:43:412016-03-23 17:43:41
Output for 7.0.0
2016-03-26 20:24:012016-03-26 19:24:01
Output for 5.6.21
2016-05-02 03:30:472016-05-02 01:30:47
Output for 5.6.20
2016-04-09 19:58:472016-04-09 17:58:47
Output for 5.6.19
2016-03-07 15:31:422016-03-07 14:31:42
Output for 5.6.18
2016-03-14 23:17:202016-03-14 22:17:20
Output for 5.6.17
2016-03-19 12:16:032016-03-19 11:16:03
Output for 5.6.16
2016-03-27 22:09:432016-03-27 20:09:43
Output for 5.6.15
2016-03-28 23:02:342016-03-28 21:02:34
Output for 5.6.14
2016-04-02 01:36:592016-04-01 23:36:59
Output for 5.6.13
2016-04-15 05:32:152016-04-15 03:32:15
Output for 5.6.12
2016-04-19 19:09:282016-04-19 17:09:28
Output for 5.6.11
2016-04-23 02:09:342016-04-23 00:09:34
Output for 5.6.10
2016-04-25 03:59:192016-04-25 01:59:19
Output for 5.6.9
2016-04-27 08:56:562016-04-27 06:56:56
Output for 5.6.8
2016-04-29 16:57:092016-04-29 14:57:09
Output for 5.6.7
2016-05-25 11:21:112016-05-25 09:21:11
Output for 5.5.35
2016-05-22 07:12:122016-05-22 05:12:12
Output for 5.5.34
2016-04-10 22:24:312016-04-10 20:24:31
Output for 5.5.33
2016-03-08 18:20:562016-03-08 17:20:56
Output for 5.5.32
2016-03-17 01:08:552016-03-17 00:08:55
Output for 5.5.31
2016-03-20 15:02:562016-03-20 14:02:56
Output for 5.5.30
2016-04-01 01:11:032016-03-31 23:11:03
Output for 5.5.29
2016-04-16 19:37:182016-04-16 17:37:18
Output for 5.5.28
2016-04-20 22:15:132016-04-20 20:15:13
Output for 5.5.27
2016-04-22 00:46:082016-04-21 22:46:08
Output for 5.5.26
2016-04-26 06:25:322016-04-26 04:25:32
Output for 5.5.25
2016-04-28 12:28:582016-04-28 10:28:58
Output for 5.5.24
2016-05-23 19:24:392016-05-23 17:24:39
Output for 5.4.45
2015-09-05 00:48:192015-09-04 22:48:19
Output for 5.4.44
2015-09-05 00:48:152015-09-04 22:48:15
Output for 5.4.43
2015-09-05 00:48:122015-09-04 22:48:12
Output for 5.4.42
2015-09-05 00:48:112015-09-04 22:48:11
Output for 5.4.41
2015-09-05 00:48:092015-09-04 22:48:09
Output for 5.4.39 - 5.4.40
2015-09-05 00:48:072015-09-04 22:48:07
Output for 5.4.38
2015-03-03 18:45:222015-03-03 17:45:22
Output for 5.4.35 - 5.4.37
2015-03-03 18:45:152015-03-03 17:45:15
Output for 5.4.34
2015-03-03 18:45:142015-03-03 17:45:14
Output for 5.4.32
2014-09-12 11:07:062014-09-12 09:07:06
Output for 5.4.31
2014-09-12 11:07:042014-09-12 09:07:04
Output for 5.3.29, 5.4.30
2014-09-12 11:06:582014-09-12 09:06:58
Output for 5.4.29
2014-09-12 11:06:572014-09-12 09:06:57
Output for 5.4.16 - 5.4.28
2014-05-29 23:49:192014-05-29 21:49:19
Output for 5.4.3 - 5.4.15
2014-05-29 23:49:202014-05-29 21:49:20
Output for 5.3.20 - 5.3.28, 5.4.0 - 5.4.2
2014-05-29 23:49:212014-05-29 21:49:21
Output for 5.3.4 - 5.3.19
2014-05-29 23:49:222014-05-29 21:49:22
Output for 5.2.2 - 5.2.17, 5.3.0 - 5.3.3
2014-05-29 23:49:232014-05-29 21:49:23
Output for 5.2.0 - 5.2.1
2014-05-29 23:49:242014-05-29 21:49:24
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/JK575 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/JK575 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/JK575 on line 2

preferences:
241.41 ms | 401 KiB | 344 Q