note 81874 deleted from function.abs by ezyang
| From: | ezyang@php.net | Date: | Mon, 17 Mar 2008 20:02:47 +0000 |
| Subject: | note 81874 deleted from function.abs by ezyang | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-137147@lists.php.net to get a copy of this message | ||
Note Submitter: Dave Schlaegel
Reason: useless
----
Here is an easy MySQL way of getting the difference in dates. For me it is more logical to do this
on the select than running it though an additional php function after selecting the date. But
depends on what your doing of course. I hope it helps.
SELECT ABS(DATEDIFF(NOW(),your_date_field)) as days_ago