ResumesInn
Welcome  ,
Interview Questions >> PHP >> How to find the number of days between two given dates using PHP?
Next Question Previous Question

How to find the number of days between two given dates using PHP?



  Joseph Ranjan wrote ...
Using difference between time stamps we can do this  ...

$date1 = "2010-08-01";
$date2 = "2011-02-01";
$number_of_days = (strtotime($date2) - strtotime($date1)) / (60 * 60 * 24);
echo "Days Between $date2 and $date1 is: $number_of_days";

Output :

Days Between 2011-02-01 and 2010-08-01 is: 184



Login to write answer for this question !
Want to place your ads in this website ?
50USD Per Month for single placement. Contact Us
All Rights Reserved . Developed by SJRANJAN