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
Tell me what is the main difference between php 4 and php 5?
What is mysql_fetch_object?
Differences between get and post methods?
Is array function in php?
Who is known as the father of php?
How does php isset work?
Inside a php function, what param needs to be set in order to access a global variable?
What is difference between compile time and run time polymorphism?
What are the advantages of stored procedures, triggers, indexes in php?
What is the purpose of the '.myd' file extension? What do thes file contain?
How cookies are trported from browsers to servers?
How can you retrieve a cookie value?
How can you associate a variable with a session?
How can we make a constant in php?
What is isset post?