Solved

PHP get current date and add 10 days to it

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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 …

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now