Hi i have some examples dates given below.How to find the next closest date in php or in mysql ?
I have some date like 12-04-2015
so now i need to get the closest date after the given date.So in my case my closest date is 15-04-2015
.How can i find using PHP and mysql ?? Any one help me
PHP
$date = date("Y-m-d");// current date
$date = strtotime(date("Y-m-d", strtotime($date)) . " +1 day");
Mysql
SELECT Birthdate FROM hedging ORDER BY ABS(DATEDIFF(Birthdate , `2015-04-12`)) LIMIT 1
How can i execute the above query in mysql ?
BirthDate
25-03-2015
10-04-2015
10-04-2015
11-04-2015
15-04-2015
30-04-2015