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
Why ide is recommended for use while programming with php?
Why php is used with mysql?
What are php applications?
Define metaphone()?
What is the meaning of symbol '$' in jquery?
What are the different types of array in php?
What is a string in r?
What is chrome logger?
What is isset post?
What is an associative array?
How to submit form without a submit button.
How many escape sequences are recognized in double-quoted strings?
Why do we use query?
How to store the uploaded file to the final location?
Which cryptographic functions in php returns the longest hash value?