Skip to content

Instantly share code, notes, and snippets.

@kruxor
Last active August 29, 2015 14:05
Show Gist options
  • Save kruxor/420c7519f07108237ba0 to your computer and use it in GitHub Desktop.
Save kruxor/420c7519f07108237ba0 to your computer and use it in GitHub Desktop.
Show the number of days difference between now and a timestamp
function time_diff_days($your_date) {
$now = time(); // or your date as well
$your_date = strtotime($your_date);
$datediff = $now - $your_date;
return floor($datediff/(60*60*24));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment