Skip to content

Instantly share code, notes, and snippets.

@asilbalaban
Created May 30, 2014 13:39
Show Gist options
  • Select an option

  • Save asilbalaban/15b1aaba9032bef6e18a to your computer and use it in GitHub Desktop.

Select an option

Save asilbalaban/15b1aaba9032bef6e18a to your computer and use it in GitHub Desktop.
Finding the number of days between two dates
<?php
$now = time(); // or your date as well
$your_date = strtotime("2010-01-01");
$datediff = $now - $your_date;
echo floor($datediff/(60*60*24));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment