3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $Draw_time = "29/01/2016 7pm"; $date = DateTime::createFromFormat("d/m/Y ha",$Draw_time); $new_date = $date->format('Y-m-d H:i:s'); $seconds = strtotime($new_date) - time(); $days = floor($seconds / 86400); $seconds %= 86400; $hours = floor($seconds / 3600); $seconds %= 3600; $minutes = floor($seconds / 60); $seconds %= 60; echo "$days days and $hours hours and $minutes minutes and $seconds seconds";
based on 9nNm7
Output for 5.5.0 - 7.2.6
2 days and 7 hours and 22 minutes and 33 seconds