View Single Post
Old 04-23-2008, 02:59 PM   #2 (permalink)
Village Idiot
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,296
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by oMIKEo View Post
Hi,

I'm trying to work out an easy way to calculate the date for next week based on the current date.

im using
PHP Code:
$varOnemktime(000date("m")  , date("d"), date("Y"));
$varTwo=  date('Y-m-d'$varOne); 
What i want is to know the date for next Mon, Tue, Wed, etc.

So if its Monday today i need to know the current date + 7, if its Tuesday i need to know current date +8, etc.

is there an easy way without a load of IF statments?

Thanks,
Mike

Using date()
PHP Code:
//I dont remember the date output codes, you will have to look them up.
$next_week date("Y-m-d",time()+(60*60*24*7)); 
Now that you have the date of next week from now, you can calculate the rest yourself
__________________

Village Idiot is offline  
Reply With Quote