I found this solution that seems to work well.
function compareDates($date1,$date2)
{
$date1_array = explode("-",$date1);
$date2_array = explode("-",$date2);
$timestamp1 = mktime(0,0,0,$date1_array[1],$date1_array[2],$date1_array[0]);
$timestamp2 = mktime(0,0,0,$date2_array[1],$date2_array[2],$date2_array[0]);
return ($timestamp1 - $timestamp2);
}
$daystillupload = compareDates( $date = date('Y-m-d'), $lastuploaddate) / 86400;