Page 1 of 1

date difference

Posted: Mon Jul 28, 2008 5:10 am
by itsmani1
Hi all

I want to calculate date difference between two times, i have a time like ('2008-07-28 23:59:59') and then interval in days like 7 days

I want to add time + interval in days and then want to find difference with the current time.


any idea....

thank you
dizyn

Re: date difference

Posted: Mon Jul 28, 2008 5:52 am
by EverLearning
I guess you're talking about MySql based on the date format. Use

Code: Select all

SELECT DATE_ADD('2008-07-28 23:59:59', INTERVAL 7 DAY);
For more information look up MySql Date and Time Functions