- date_diff: documentation ( source)
<?php
$today = new DateTime();
$currentLocationTime = new DateTime( '2014-08-01 16:27:33' ); //formatting date time string to date
$gap = date_diff( $today, $currentLocationTime ) -> format( '%d' );
echo $gap;
?>