Jump to content

How do I subtract 3 weeks from a variable?


dmirsch

Recommended Posts

I have the following code:

		//DETERMINES ASL POLICY
	if ($perfRow['ASL']=='ToArrange'){ 
	$ASLdate = $perfRow['startDateTime'];
	$ASLconfirm = strtotime($ASLdate-'21 days');
		echo "<!--[ASL=ToARRANGE--><p>An ASL Interpreted performance of this event is offered on".date("l, F j",strtotime($perfRow['startDateTime']))." at ".date("g:i a",strtotime($perfRow['startDateTime'])).".<br />Please contact me by ".date("l, F j",strtotime($ASLconfirm))." to confirm this service.</p>";
	}

What I need is that if the ASL is "To be Arranged" there is a date that lists for $ASLconfirm that is three weeks prior to $ASLdate.

The code above gives me the following:

An ASL Interpreted performance of this event is offered on Friday, September 28 at 7:30 pm.

Please contact me by Wednesday, December 31 to confirm this service.

As you can see from the output the December date is NOT three weeks prior to the September date.

Where did I go wrong in my coding?

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.