Jump to content

Date plus 2 days


Wickham

Recommended Posts

If this is the PHP date format:

echo date("d M Y");

 

how do I add 2 days to the current date?

If it's 31 December 2009 I don't want 33 December 2009.

Presumably I have to create variables for p and M and Y and add 2 days to d and then check if it goes beyond the month and year somehow.

Link to comment
Share on other sites

Sorry, I'm answering my own post again, I've found a way to do it:-

 

$day2 = mktime(0,0,0,date("m"),date("d")+2,date("Y"));

 

and in the processing part of the PHP:-

 

if($State == "NY")

{

echo "$FirstName $LastName - we will get back to you within 2 days, ie before " .date("d M Y", $day2); exit;

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...