3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $format = 'Y-m-d H:i:s'; $date = new DateTime(); $date->setTimezone(new DateTimeZone('Europe/Berlin')); $date->createFromFormat($format, '2012-04-21 12:42:59'); echo $date->format($format); $date->setTimezone(new DateTimeZone('UTC')); echo $date->format($format);
based on CauAb
Output for 5.6.28, 7.0.20 - 7.2.0
2016-01-12 11:00:482016-01-12 10:00:48
Output for 7.0.6
2016-05-21 13:40:422016-05-21 11:40:42
Output for 7.0.5
2016-04-03 09:39:372016-04-03 07:39:37
Output for 7.0.4
2016-03-10 21:46:232016-03-10 20:46:23
Output for 7.0.3
2016-03-18 23:12:542016-03-18 22:12:54
Output for 7.0.2
2016-03-23 05:26:122016-03-23 04:26:12
Output for 7.0.1
2016-03-24 08:31:102016-03-24 07:31:10
Output for 7.0.0
2016-03-27 10:24:252016-03-27 08:24:25
Output for 5.6.21
2016-05-02 16:33:282016-05-02 14:33:28
Output for 5.6.20
2016-04-10 08:41:472016-04-10 06:41:47
Output for 5.6.19
2016-03-08 05:55:332016-03-08 04:55:33
Output for 5.6.18
2016-03-15 14:53:302016-03-15 13:53:30
Output for 5.6.17
2016-03-20 02:26:032016-03-20 01:26:03
Output for 5.6.16
2016-03-28 11:14:042016-03-28 09:14:04
Output for 5.6.15
2016-03-29 12:03:372016-03-29 10:03:37
Output for 5.6.14
2016-04-14 17:46:062016-04-14 15:46:06
Output for 5.6.13
2016-04-15 18:25:062016-04-15 16:25:06
Output for 5.6.12
2016-04-20 08:54:172016-04-20 06:54:17
Output for 5.6.11
2016-04-24 15:20:382016-04-24 13:20:38
Output for 5.6.10
2016-04-25 17:26:232016-04-25 15:26:23
Output for 5.6.9
2016-04-27 22:52:382016-04-27 20:52:38
Output for 5.6.8
2016-04-30 07:21:502016-04-30 05:21:50
Output for 5.5.35
2016-05-23 02:35:382016-05-23 00:35:38
Output for 5.5.34
2016-04-11 10:55:372016-04-11 08:55:37
Output for 5.5.33
2016-03-09 08:54:352016-03-09 07:54:35
Output for 5.5.32
2016-03-17 18:51:022016-03-17 17:51:02
Output for 5.5.31
2016-03-21 05:36:482016-03-21 04:36:48
Output for 5.5.30
2016-04-01 13:55:042016-04-01 11:55:04
Output for 5.5.29
2016-04-17 08:42:492016-04-17 06:42:49
Output for 5.5.28
2016-04-21 12:13:532016-04-21 10:13:53
Output for 5.5.27
2016-04-22 13:51:042016-04-22 11:51:04
Output for 5.5.26
2016-04-26 20:07:562016-04-26 18:07:56
Output for 5.5.25
2016-04-29 03:33:432016-04-29 01:33:43
Output for 5.5.24
2016-05-24 09:56:282016-05-24 07:56:28
Output for 5.4.45
2016-01-12 11:00:522016-01-12 10:00:52
Output for 5.4.44
2016-01-12 11:00:532016-01-12 10:00:53
Output for 5.4.42 - 5.4.43
2016-01-12 11:00:542016-01-12 10:00:54
Output for 5.4.41
2016-01-12 11:00:552016-01-12 10:00:55
Output for 5.4.40
2016-01-12 11:00:562016-01-12 10:00:56
Output for 5.4.38 - 5.4.39
2016-01-12 11:00:582016-01-12 10:00:58
Output for 5.4.36 - 5.4.37
2016-01-12 11:00:592016-01-12 10:00:59
Output for 5.4.34 - 5.4.35
2016-01-12 11:01:002016-01-12 10:01:00
Output for 5.3.29, 5.4.31 - 5.4.32
2016-01-12 11:01:012016-01-12 10:01:01
Output for 5.4.30

Process exited with code 137.
Output for 5.4.27 - 5.4.29
2016-01-12 11:01:022016-01-12 10:01:02
Output for 5.4.24 - 5.4.26
2016-01-12 11:01:032016-01-12 10:01:03
Output for 5.3.28, 5.4.21 - 5.4.23
2016-01-12 11:01:042016-01-12 10:01:04
Output for 5.4.18 - 5.4.20
2016-01-12 11:01:052016-01-12 10:01:05
Output for 5.3.24 - 5.3.27, 5.4.15 - 5.4.17
2016-01-12 11:01:062016-01-12 10:01:06
Output for 5.3.21 - 5.3.23, 5.4.11 - 5.4.14
2016-01-12 11:01:072016-01-12 10:01:07