3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = '011104'; $date = DateTime::createFromFormat('dmy', $str); var_dump($date);
based on m8GLI
Output for 5.5.14 - 5.5.29, 5.5.31 - 5.6.15, 5.6.17 - 7.3.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2004-11-01 18:31:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30, 5.6.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2004-11-01 18:31:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.0 - 5.5.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2004-11-01 18:31:43" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.45
object(DateTime)#1 (3) { ["date"]=> string(26) "2004-11-01 18:31:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.44
object(DateTime)#1 (3) { ["date"]=> string(26) "2004-11-01 18:31:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.41 - 5.4.43
object(DateTime)#1 (3) { ["date"]=> string(26) "2004-11-01 18:31:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.40
object(DateTime)#1 (3) { ["date"]=> string(26) "2004-11-01 18:31:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.38 - 5.4.39
object(DateTime)#1 (3) { ["date"]=> string(26) "2004-11-01 18:31:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.36 - 5.4.37
object(DateTime)#1 (3) { ["date"]=> string(26) "2004-11-01 18:31:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.34 - 5.4.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2004-11-01 18:31:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.31 - 5.4.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2004-11-01 18:31:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2004-11-01 18:31:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.27 - 5.4.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2004-11-01 18:31:54" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.24 - 5.4.26
object(DateTime)#1 (3) { ["date"]=> string(19) "2004-11-01 18:31:55" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.28, 5.4.21 - 5.4.23
object(DateTime)#1 (3) { ["date"]=> string(19) "2004-11-01 18:31:56" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.18 - 5.4.20
object(DateTime)#1 (3) { ["date"]=> string(19) "2004-11-01 18:31:57" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.25 - 5.3.27, 5.4.15 - 5.4.17
object(DateTime)#1 (3) { ["date"]=> string(19) "2004-11-01 18:31:58" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.22 - 5.3.24, 5.4.12 - 5.4.14
object(DateTime)#1 (3) { ["date"]=> string(19) "2004-11-01 18:31:59" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2004-11-01 18:31:53" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }