Solved

PHP get current date and add 10 days to it

Posted on 2008-10-10
5
2,280 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

778 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