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
What are different types of Print Functions available in PHP?
What is the use of header in php?
What type of headers that PHP supports?
What is the use of callback in php?
When you want to show some part of a text displayed on an html page in red font color? What different possibilities are there to do this? What are the advantages/disadvantages of these methods?
Tell us how can we display the output directly to the browser?
Which variable declarations within a class is invalid in php?
How to get number of days between two given dates using PHP?
Tell me is it possible to submit a form with a dedicated button?
Is gender a dependent variable?
How does php sessions work?
How does api connect to database?
Is it possible to extend the execution time of a php script?
The left association operator % is used in PHP for?
Is wordpress a php framework?