FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Help!! Date question.. (SOLVED)





avk
Hello!!
I have a problem and the problem is...

How do I ge the date after a no. of Days...

For Example: 12/5/2002 is the given date
90 is the given no. of Days.

Then i have to find out the date after 90 days after 12/5/2006.
Rhysige
I think the PHP date() function can have a timestamp subbed into it.. so to display the date in 90 days it would be
Code:

$time = time() + (60 * 60 * 24 * 90);
echo date($time);

I dunno if that will work but try? basically your subbing in a new PHP timestamp instead of the default which is the current one.
ganbate
you can use this code to calculate number of days or month after given date.
Code:

$g_day = 12; //given day
$g_month = 5; //given month
$g_year = 2006; //given year
$num_day = 90; //number of days after given date
$num_month = 0; //number of mont after given date
echo date ("j/n/Y", mktime (0,0,0,$g_month+$num_month,$g_day+$num_day,$g_year));
avk
Thankyou!!

It helped..

Got my answer.
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.