3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $timezone = 'Europe/Berlin'; $date = gmdate('M d Y H:i:s', 1401886870 - 86400); $takeIn = new \DateTime($date, new \DateTimeZone($timezone)); $date = gmdate('M d Y H:i:s', 1401886870); $actualTakeIn = new \DateTime($date, new \DateTimeZone($timezone)); $interval = $takeIn->diff($actualTakeIn); echo $interval->format('%a');