Page 1 of 1

confusing date function..

Posted: Wed May 28, 2008 12:04 am
by iyddaz
hi all
i hav two dates in datebase. i need to find out the days between those two dates.
for exmaple
if i hav 2008-05-26 and 2008-06-02 then the answer should be 7 day.



plz help me any one as soon as possible.. thankx bye... :banghead:

Re: confusing date function..

Posted: Wed May 28, 2008 12:13 am
by Christopher
Databases have functions for this: http://dev.mysql.com/doc/refman/4.1/en/ ... n_datediff

In PHP you would convert them to Unix timestamps and subtract.

Re: confusing date function..

Posted: Wed May 28, 2008 2:18 am
by iyddaz
thanks