On Apr 21, 2010, at 5:39 AM, Michiel Sikma wrote:

> On 20 April 2010 17:40, Floyd Resler <fres...@adex-intl.com> wrote:
>> I need to get the difference in months between two dates.  The dates could
>> be as much as 60 months apart.  Is there any easy way to do this either
>> through PHP or MySQL?  I know how I can do it through code but thought there
>> might be a simple one or two line option.
>> Thanks!
>> Floyd
> You're best off doing this in MySQL.
> Something like select timestampdiff(month, '2010-01-01', '2010-05-22');
> should work.
> Michiel

Perfect!  That's exactly what I was looking for!
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to