Re: Calculating difference between two days
| From: | Richard Lynch | Date: | Thu, 15 Jun 2006 06:56:29 +0000 |
| Subject: | Re: Calculating difference between two days | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238037@lists.php.net to get a copy of this message | ||
On Wed, June 14, 2006 11:45 am, afan@afan.net wrote:
> I need to calculate no. of days between two dates, actually between
> date
> stored in DB and today's date.
Almost for sure your best answer is actually in your SQL engine with
something like date_subtract in MySQL.
PHP's date functions are, err, a but unwieldy...
I mean, okay, if you already have the four or five different software
packages installed, and you understand them, I'm sure it's really very
nice, but for the simple usage, for what most people need, the SQL
date-handling is generally sufficient and easier.
> Does anybody has an example I can use?
http://dev.mysql.com/ will have one if you search for date_add,
almost
for sure.
--
Like Music?
http://l-i-e.com/artists.htm