confusing date function..

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
iyddaz
Forum Newbie
Posts: 3
Joined: Tue May 13, 2008 1:08 am

confusing date function..

Post 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:
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: confusing date function..

Post 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.
(#10850)
iyddaz
Forum Newbie
Posts: 3
Joined: Tue May 13, 2008 1:08 am

Re: confusing date function..

Post by iyddaz »

thanks
Post Reply