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
Which is the dependent variable?
How can we destroy the cookie in php?
How a variable is declared in php?
What are the uses of explode() and implode() functions?
Write a program in php to print a table of a number?
Why we use get in php?
How does the identity operator ===compare two values in PHP?
Tell me what is the use of isset() in php?
What are html entities?
What is php mainly used for?
What is a static variable in php?
How can we define a variable accessible in functions of a php script?
What is alias in php?
Explain about getters and setters in php?
What is list in PHP?