04-23-2008, 02:59 PM
|
#2 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,296
Thanks: 17
|
Quote:
Originally Posted by oMIKEo
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:
$varOne= mktime(0, 0, 0, date("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
|
|
|
|