3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $format = 'H:s:i'; $date = DateTime::createFromFormat($format, '03:00:00'); $date->add('P1D'); echo "Format: $format; " . $date->format('Y-m-d H:i:s') . "\n";
based on lkhfM
Output for 5.3.20 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2015-12-02 03:00:00
Output for 7.0.6
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-05-03 03:00:00
Output for 7.0.5
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-03 03:00:00
Output for 7.0.4
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-03-10 03:00:00
Output for 7.0.3
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-03-18 03:00:00
Output for 7.0.2
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-03-23 03:00:00
Output for 7.0.1
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-03-24 03:00:00
Output for 7.0.0
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-03-27 03:00:00
Output for 5.6.21
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-05-02 03:00:00
Output for 5.6.20
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-10 03:00:00
Output for 5.6.19
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-03-08 03:00:00
Output for 5.6.18
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-03-15 03:00:00
Output for 5.6.17
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-03-20 03:00:00
Output for 5.6.16
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-03-28 03:00:00
Output for 5.6.15
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-03-29 03:00:00
Output for 5.6.14
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-14 03:00:00
Output for 5.6.13
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-15 03:00:00
Output for 5.6.12
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-20 03:00:00
Output for 5.6.11
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-24 03:00:00
Output for 5.6.10
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-25 03:00:00
Output for 5.6.9
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-27 03:00:00
Output for 5.6.8
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-30 03:00:00
Output for 5.5.35
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-05-23 03:00:00
Output for 5.5.34
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-11 03:00:00
Output for 5.5.33
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-03-09 03:00:00
Output for 5.5.32
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-03-17 03:00:00
Output for 5.5.31
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-03-21 03:00:00
Output for 5.5.30
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-01 03:00:00
Output for 5.5.29
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-17 03:00:00
Output for 5.5.28
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-21 03:00:00
Output for 5.5.27
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-22 03:00:00
Output for 5.5.26
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-26 03:00:00
Output for 5.5.25
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-04-29 03:00:00
Output for 5.5.24
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/lEj1Q on line 4 Format: H:s:i; 2016-05-24 03:00:00