3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime(); $date->setTimezone(new DateTimeZone('Europe/Berlin')); $date->setDate('2012-04-21'); $date->setTime('12:42:59'); echo $date->format('Y-m-d H:i:s'); $date->setTimezone(new DateTimeZone('UTC')); echo $date->format('Y-m-d H:i:s');
Output for 5.6.28, 7.1.0 - 7.2.0
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:002016-01-12 09:44:00
Output for 7.0.20
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:012016-01-12 09:44:01
Output for 7.0.6
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-05-21 13:40:392016-05-21 11:40:39
Output for 7.0.5
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-03 09:39:332016-04-03 07:39:33
Output for 7.0.4
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-03-10 21:46:202016-03-10 20:46:20
Output for 7.0.3
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-03-18 23:12:502016-03-18 22:12:50
Output for 7.0.2
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-03-23 05:26:082016-03-23 04:26:08
Output for 7.0.1
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-03-24 08:31:072016-03-24 07:31:07
Output for 7.0.0
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-03-27 10:24:212016-03-27 08:24:21
Output for 5.6.21
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-05-02 16:33:252016-05-02 14:33:25
Output for 5.6.20
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-10 08:41:422016-04-10 06:41:42
Output for 5.6.19
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-03-08 05:55:302016-03-08 04:55:30
Output for 5.6.18
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-03-15 14:53:242016-03-15 13:53:24
Output for 5.6.17
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-03-20 02:26:002016-03-20 01:26:00
Output for 5.6.16
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-03-28 11:14:012016-03-28 09:14:01
Output for 5.6.15
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-03-29 12:03:342016-03-29 10:03:34
Output for 5.6.14
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-14 17:46:032016-04-14 15:46:03
Output for 5.6.13
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-15 18:25:032016-04-15 16:25:03
Output for 5.6.12
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-20 08:54:132016-04-20 06:54:13
Output for 5.6.11
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-24 15:20:352016-04-24 13:20:35
Output for 5.6.10
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-25 17:26:192016-04-25 15:26:19
Output for 5.6.9
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-27 22:52:352016-04-27 20:52:35
Output for 5.6.8
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-30 07:21:472016-04-30 05:21:47
Output for 5.5.35
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-05-23 02:35:352016-05-23 00:35:35
Output for 5.5.34
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-11 10:55:342016-04-11 08:55:34
Output for 5.5.33
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-03-09 08:54:312016-03-09 07:54:31
Output for 5.5.32
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-03-17 18:50:582016-03-17 17:50:58
Output for 5.5.31
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-03-21 05:36:442016-03-21 04:36:44
Output for 5.5.30
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-01 13:55:012016-04-01 11:55:01
Output for 5.5.29
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-17 08:42:462016-04-17 06:42:46
Output for 5.5.28
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-21 12:13:502016-04-21 10:13:50
Output for 5.5.27
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-22 13:51:022016-04-22 11:51:02
Output for 5.5.26
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-26 20:07:532016-04-26 18:07:53
Output for 5.5.25
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-04-29 03:33:402016-04-29 01:33:40
Output for 5.5.24
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-05-24 09:56:252016-05-24 07:56:25
Output for 5.4.45
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:032016-01-12 09:44:03
Output for 5.4.44
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:042016-01-12 09:44:04
Output for 5.4.42 - 5.4.43
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:052016-01-12 09:44:05
Output for 5.4.40 - 5.4.41
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:062016-01-12 09:44:06
Output for 5.4.38 - 5.4.39
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:072016-01-12 09:44:07
Output for 5.4.35 - 5.4.37
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:082016-01-12 09:44:08
Output for 5.4.34
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:092016-01-12 09:44:09
Output for 5.3.29, 5.4.29 - 5.4.32
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:102016-01-12 09:44:10
Output for 5.4.26 - 5.4.28
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:112016-01-12 09:44:11
Output for 5.3.28, 5.4.23 - 5.4.25
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:122016-01-12 09:44:12
Output for 5.4.19 - 5.4.22
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:132016-01-12 09:44:13
Output for 5.3.26 - 5.3.27, 5.4.16 - 5.4.18
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:142016-01-12 09:44:14
Output for 5.3.23 - 5.3.25, 5.4.12 - 5.4.15
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:152016-01-12 09:44:15
Output for 5.3.21 - 5.3.22, 5.4.11
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/kN3iO on line 5 Warning: DateTime::setTime() expects at least 2 parameters, 1 given in /in/kN3iO on line 6 2016-01-12 10:44:162016-01-12 09:44:16