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');
based on kN3iO
Output for 5.3.21 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-01-12 12:42:592016-01-12 11:42:59
Output for 7.0.6
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-05-21 12:42:592016-05-21 10:42:59
Output for 7.0.5
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-03 12:42:592016-04-03 10:42:59
Output for 7.0.4
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-03-10 12:42:592016-03-10 11:42:59
Output for 7.0.3
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-03-18 12:42:592016-03-18 11:42:59
Output for 7.0.2
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-03-23 12:42:592016-03-23 11:42:59
Output for 7.0.1
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-03-24 12:42:592016-03-24 11:42:59
Output for 7.0.0
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-03-27 12:42:592016-03-27 10:42:59
Output for 5.6.21
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-05-02 12:42:592016-05-02 10:42:59
Output for 5.6.20
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-10 12:42:592016-04-10 10:42:59
Output for 5.6.19
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-03-08 12:42:592016-03-08 11:42:59
Output for 5.6.18
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-03-15 12:42:592016-03-15 11:42:59
Output for 5.6.17
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-03-20 12:42:592016-03-20 11:42:59
Output for 5.6.16
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-03-28 12:42:592016-03-28 10:42:59
Output for 5.6.15
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-03-29 12:42:592016-03-29 10:42:59
Output for 5.6.14
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-14 12:42:592016-04-14 10:42:59
Output for 5.6.13
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-15 12:42:592016-04-15 10:42:59
Output for 5.6.12
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-20 12:42:592016-04-20 10:42:59
Output for 5.6.11
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-24 12:42:592016-04-24 10:42:59
Output for 5.6.10
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-25 12:42:592016-04-25 10:42:59
Output for 5.6.9
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-27 12:42:592016-04-27 10:42:59
Output for 5.6.8
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-30 12:42:592016-04-30 10:42:59
Output for 5.5.35
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-05-23 12:42:592016-05-23 10:42:59
Output for 5.5.34
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-11 12:42:592016-04-11 10:42:59
Output for 5.5.33
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-03-09 12:42:592016-03-09 11:42:59
Output for 5.5.32
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-03-17 12:42:592016-03-17 11:42:59
Output for 5.5.31
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-03-21 12:42:592016-03-21 11:42:59
Output for 5.5.30
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-01 12:42:592016-04-01 10:42:59
Output for 5.5.29
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-17 12:42:592016-04-17 10:42:59
Output for 5.5.28
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-21 12:42:592016-04-21 10:42:59
Output for 5.5.27
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-22 12:42:592016-04-22 10:42:59
Output for 5.5.26
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-26 12:42:592016-04-26 10:42:59
Output for 5.5.25
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-04-29 12:42:592016-04-29 10:42:59
Output for 5.5.24
Warning: DateTime::setDate() expects exactly 3 parameters, 1 given in /in/cav8I on line 5 2016-05-24 12:42:592016-05-24 10:42:59