3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date1 = new DateTime("now"); $date2 = new DateTime("tomorrow"); echo $date1->format('Y-m-d H:i:s'); echo $date2->format('Y-m-d H:i:s'); $date2->setTime(6,0); echo $date2->format('Y-m-d H:i:s');
based on sAHX2
Output for 7.0.20 - 7.2.0
2015-12-01 04:10:462015-12-02 00:00:002015-12-02 06:00:00
Output for 7.0.6
2016-05-03 19:51:102016-05-04 00:00:002016-05-04 06:00:00
Output for 7.0.5
2016-04-03 08:11:062016-04-04 00:00:002016-04-04 06:00:00
Output for 7.0.4
2016-03-10 20:05:112016-03-11 00:00:002016-03-11 06:00:00
Output for 7.0.3
2016-03-18 21:26:092016-03-19 00:00:002016-03-19 06:00:00
Output for 7.0.2
2016-03-23 03:39:582016-03-24 00:00:002016-03-24 06:00:00
Output for 7.0.1
2016-03-24 06:57:042016-03-25 00:00:002016-03-25 06:00:00
Output for 7.0.0
2016-03-27 08:51:352016-03-28 00:00:002016-03-28 06:00:00
Output for 5.6.21
2016-05-02 14:59:102016-05-03 00:00:002016-05-03 06:00:00
Output for 5.6.20
2016-04-10 07:12:172016-04-11 00:00:002016-04-11 06:00:00
Output for 5.6.19
2016-03-08 04:17:472016-03-09 00:00:002016-03-09 06:00:00
Output for 5.6.18
2016-03-15 13:07:502016-03-16 00:00:002016-03-16 06:00:00
Output for 5.6.17
2016-03-20 00:42:562016-03-21 00:00:002016-03-21 06:00:00
Output for 5.6.16
2016-03-28 09:40:412016-03-29 00:00:002016-03-29 06:00:00
Output for 5.6.15
2016-03-29 10:30:172016-03-30 00:00:002016-03-30 06:00:00
Output for 5.6.14
2016-04-02 12:20:272016-04-03 00:00:002016-04-03 06:00:00
Output for 5.6.13
2016-04-15 16:51:422016-04-16 00:00:002016-04-16 06:00:00
Output for 5.6.12
2016-04-20 07:18:322016-04-21 00:00:002016-04-21 06:00:00
Output for 5.6.11
2016-04-24 13:43:172016-04-25 00:00:002016-04-25 06:00:00
Output for 5.6.10
2016-04-25 15:47:052016-04-26 00:00:002016-04-26 06:00:00
Output for 5.6.9
2016-04-27 20:55:312016-04-28 00:00:002016-04-28 06:00:00
Output for 5.6.8
2016-04-30 05:44:322016-05-01 00:00:002016-05-01 06:00:00
Output for 5.5.35
2016-05-22 23:54:542016-05-23 00:00:002016-05-23 06:00:00
Output for 5.5.34
2016-04-11 09:23:392016-04-12 00:00:002016-04-12 06:00:00
Output for 5.5.33
2016-03-09 07:10:262016-03-10 00:00:002016-03-10 06:00:00
Output for 5.5.32
2016-03-17 16:59:092016-03-18 00:00:002016-03-18 06:00:00
Output for 5.5.31
2016-03-21 03:48:202016-03-22 00:00:002016-03-22 06:00:00
Output for 5.5.30
2016-04-01 12:23:152016-04-02 00:00:002016-04-02 06:00:00
Output for 5.5.29
2016-04-17 07:09:462016-04-18 00:00:002016-04-18 06:00:00
Output for 5.5.28
2016-04-21 10:34:202016-04-22 00:00:002016-04-22 06:00:00
Output for 5.5.27
2016-04-22 12:17:052016-04-23 00:00:002016-04-23 06:00:00
Output for 5.5.26
2016-04-26 18:27:442016-04-27 00:00:002016-04-27 06:00:00
Output for 5.5.25
2016-04-29 01:51:032016-04-30 00:00:002016-04-30 06:00:00
Output for 5.5.24
2016-05-24 08:02:292016-05-25 00:00:002016-05-25 06:00:00
Output for 5.4.45
2015-12-01 04:10:482015-12-02 00:00:002015-12-02 06:00:00
Output for 5.4.44
2015-12-01 04:10:492015-12-02 00:00:002015-12-02 06:00:00
Output for 5.4.43
2015-12-01 04:10:502015-12-02 00:00:002015-12-02 06:00:00
Output for 5.4.41 - 5.4.42
2015-12-01 04:10:512015-12-02 00:00:002015-12-02 06:00:00
Output for 5.4.40
2015-12-01 04:10:522015-12-02 00:00:002015-12-02 06:00:00
Output for 5.4.37 - 5.4.39
2015-12-01 04:10:532015-12-02 00:00:002015-12-02 06:00:00
Output for 5.4.34 - 5.4.36
2015-12-01 04:10:542015-12-02 00:00:002015-12-02 06:00:00
Output for 5.3.29, 5.4.31 - 5.4.32
2015-12-01 04:10:552015-12-02 00:00:002015-12-02 06:00:00
Output for 5.4.26 - 5.4.30
2015-12-01 04:10:562015-12-02 00:00:002015-12-02 06:00:00
Output for 5.3.28, 5.4.23 - 5.4.25
2015-12-01 04:10:572015-12-02 00:00:002015-12-02 06:00:00
Output for 5.4.19 - 5.4.22
2015-12-01 04:10:582015-12-02 00:00:002015-12-02 06:00:00
Output for 5.3.25 - 5.3.27, 5.4.15 - 5.4.18
2015-12-01 04:10:592015-12-02 00:00:002015-12-02 06:00:00
Output for 5.3.20 - 5.3.24, 5.4.11 - 5.4.14
2015-12-01 04:11:002015-12-02 00:00:002015-12-02 06:00:00
Output for 5.4.10
2015-12-01 04:11:012015-12-02 00:00:002015-12-02 06:00:00