Last active
August 29, 2015 14:05
-
-
Save kruxor/420c7519f07108237ba0 to your computer and use it in GitHub Desktop.
Show the number of days difference between now and a timestamp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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