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

Why ide is recommended for use while programming with php?

865


Why php is used with mysql?

975


What are php applications?

901


Define metaphone()?

8655


What is the meaning of symbol '$' in jquery?

988


What are the different types of array in php?

921


What is a string in r?

884


What is chrome logger?

918


What is isset post?

974


What is an associative array?

981


How to submit form without a submit button.

998


How many escape sequences are recognized in double-quoted strings?

952


Why do we use query?

877


How to store the uploaded file to the final location?

935


Which cryptographic functions in php returns the longest hash value?

946