3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function fix_strtotime($date) { if(preg_match('/([012]?[0-9]?:[0-5]{1}\d\s*[aA|pP]?[mM]?)(\s+)(.+)/', $date, $matches)) { return strtotime($matches[3] . $matches[2] . $matches[1]); } return strtotime($date); } echo date('Y-m-d H:i:s', fix_strtotime('-3 days 04:00'));
Output for 4.3.0 - 7.1.0
2013-07-29 04:00:00