Jump to content

[SOLVED] Adding days/weeks to a date


joesaddigh

Recommended Posts

Hi,

 

I am having a problem which i think is probably quite simple to solve but I cant seem to do it.

 

I am trying to add weeks or days to a date (not todays date)

 

I have a date variable and I want to add a duration variable to it>

 

The code I have is as follows.

 

 

echo 'The original date is ' . $sqldate;
                        	
                        	echo '<br />';
                        	echo '<br />';
                        	
                        	$sqldate = strtotime("+2 days");
                        	echo 'The new date is ' . $sqldate = date($sqldate);

 

$sqldate contains this value 2009-08-17

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/166059-solved-adding-daysweeks-to-a-date/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.