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(new DateInterval('P1D')); echo "Format: $format; " . $date->format('Y-m-d H:i:s') . "\n";
based on imS6B
Output for 5.3.20 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
Format: H:s:i; 2015-12-03 03:00:00
Output for 7.0.6
Format: H:s:i; 2016-05-04 03:00:00
Output for 7.0.5
Format: H:s:i; 2016-04-04 03:00:00
Output for 7.0.4
Format: H:s:i; 2016-03-11 03:00:00
Output for 7.0.3
Format: H:s:i; 2016-03-19 03:00:00
Output for 7.0.2
Format: H:s:i; 2016-03-24 03:00:00
Output for 7.0.1
Format: H:s:i; 2016-03-25 03:00:00
Output for 7.0.0
Format: H:s:i; 2016-03-28 03:00:00
Output for 5.6.21
Format: H:s:i; 2016-05-03 03:00:00
Output for 5.6.20
Format: H:s:i; 2016-04-11 03:00:00
Output for 5.6.19
Format: H:s:i; 2016-03-09 03:00:00
Output for 5.6.18
Format: H:s:i; 2016-03-16 03:00:00
Output for 5.6.17
Format: H:s:i; 2016-03-21 03:00:00
Output for 5.6.16
Format: H:s:i; 2016-03-29 03:00:00
Output for 5.6.15
Format: H:s:i; 2016-03-30 03:00:00
Output for 5.6.14
Format: H:s:i; 2016-04-15 03:00:00
Output for 5.6.13
Format: H:s:i; 2016-04-16 03:00:00
Output for 5.6.12
Format: H:s:i; 2016-04-21 03:00:00
Output for 5.6.11
Format: H:s:i; 2016-04-25 03:00:00
Output for 5.6.10
Format: H:s:i; 2016-04-26 03:00:00
Output for 5.6.9
Format: H:s:i; 2016-04-28 03:00:00
Output for 5.6.8
Format: H:s:i; 2016-05-01 03:00:00
Output for 5.5.35
Format: H:s:i; 2016-05-24 03:00:00
Output for 5.5.34
Format: H:s:i; 2016-04-12 03:00:00
Output for 5.5.33
Format: H:s:i; 2016-03-10 03:00:00
Output for 5.5.32
Format: H:s:i; 2016-03-18 03:00:00
Output for 5.5.31
Format: H:s:i; 2016-03-22 03:00:00
Output for 5.5.30
Format: H:s:i; 2016-04-02 03:00:00
Output for 5.5.29
Format: H:s:i; 2016-04-18 03:00:00
Output for 5.5.28
Format: H:s:i; 2016-04-22 03:00:00
Output for 5.5.27
Format: H:s:i; 2016-04-23 03:00:00
Output for 5.5.26
Format: H:s:i; 2016-04-27 03:00:00
Output for 5.5.25
Format: H:s:i; 2016-04-30 03:00:00
Output for 5.5.24
Format: H:s:i; 2016-05-25 03:00:00