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
How come the code works, but doesn’t for two-dimensional array of mine?
What's the difference between accessing a class method via -> and via ::?
What is lazy loading in php?
Is python similar to php?
What is difference between post and put in rest?
What is a lambda function in php?
What is the function of trim?
How does the identity operator ===compare two values in PHP?
How is a session id generated?
Explain how can we execute a php script using command line?
Tell me can the value of a constant change during the script's execution?
How do I get csrf token?
What is the use of mysqli_real_escape_string() function?
Describe which programming language does php parallel to?
Tell me what is the difference between exception::getmessage and exception::getline?