3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = '26/10/1992'; $dateNew = '1992-10-26 12:12:12'; var_dump(DateTime::createFromFormat('d/m/Y', $date)); var_dump(new DateTime($dateNew));
based on TumvK
Output for 5.6.0 - 5.6.30, hhvm-3.21.3, 7.1.0 - 7.3.0alpha1
object(DateTime)#1 (3) { ["date"]=> string(26) "1992-10-26 14:26:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "1992-10-26 12:12:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.18.5, hhvm-3.22.0
object(DateTime)#1 (3) { ["date"]=> string(26) "1992-10-26 14:26:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#1 (3) { ["date"]=> string(26) "1992-10-26 12:12:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }