Solved

PHP get current date and add 10 days to it

Posted on 2008-10-10
5
2,283 Views
Last Modified: 2012-06-27
I need a simple php script that will get the current date, add 10 days to it, and then print it out in the format:

Day (Ex. Tuesday), MM/DD/YYYY

This is relatively simple but I don't know what to do if the current date is Oct 26 and not print out something dumb like Oct 36

Thanks in advance
0
Comment
Question by:Doomtomb
  • 2
  • 2
5 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 250 total points
ID: 22689111
echo date('m/d/Y',strtotime("+10 days"));
0
 

Author Closing Comment

by:Doomtomb
ID: 31505118
Didn't know it was that easy! Thanks for the fast response.
0
 
LVL 1

Expert Comment

by:jarospirit
ID: 22689159
small modification

      echo date('l, m/d/Y',strtotime("+10 days"));
0
 

Author Comment

by:Doomtomb
ID: 22689176
:X I already assigned the points >_<

but thanks for getting me the exact code for what I asked :) Attention to detail.
0
 
LVL 82

Expert Comment

by:hielo
ID: 22689182
you are welcome.
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question