Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / vipul dalwala

php
-------------------------------------------------------
$noofdays = ceil(((strtotime($endDate) - strtotime
($startDate)) / (60*60*24)))


Mysql
-------------------------------------------------------
SELECT ((UNIX_TIMESTAMP('2007-10-01') - UNIX_TIMESTAMP
('2007-09-04'))/(60*60*24)) AS dateDiff;

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How come the code works, but doesn’t for two-dimensional array of mine?

985


What's the difference between accessing a class method via -> and via ::?

1051


What is lazy loading in php?

918


Is python similar to php?

985


What is difference between post and put in rest?

960


What is a lambda function in php?

1046


What is the function of trim?

888


How does the identity operator ===compare two values in PHP?

1037


How is a session id generated?

959


Explain how can we execute a php script using command line?

979


Tell me can the value of a constant change during the script's execution?

1163


How do I get csrf token?

930


What is the use of mysqli_real_escape_string() function?

875


Describe which programming language does php parallel to?

917


Tell me what is the difference between exception::getmessage and exception::getline?

871