Reputation: 21
I need to get a date such as '2010-04-27' as a string in php and find the nearest 5 dates in a table. The date in the table are saved as a date type.
Upvotes: 2
Views: 281
Reputation: 3037
you could also query the difference eg. something like
abs(datediff(date, $date))
then order by this
Upvotes: 2