Number of days between two given dates using PHP

<<Previous   Next>>

PHP - How can we know the number of days between two given dates using PHP? - Jan 22, 2009 at 18:00 pm by Rajmeet Ghai

How can we know the number of days between two given dates using PHP?

The start date and end date can be first found as shown below:

$date1= strotime($start_date);
$date2= strotime($end_date);
$date_diff = (($date1)- ($date2)) / (60*60*24) 

<<Previous   Next>>
 



Write your comment - Share Knowledge and Experience


 

 
Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring