Solved

problem with dates

Posted on 2000-03-13
2
168 Views
Last Modified: 2006-11-17
from a form I am taking a date input. Say the user enters some date,Now  I want to add 280 or(say some number) to the above date and get a new date which I wiil be showing to the user on submit.

Please advice how to go about doing this using php with example if possible.
0
Comment
Question by:qader99
2 Comments
 
LVL 8

Accepted Solution

by:
us111 earned 10 total points
ID: 2616895
<?
# Add 100 days
$MOREDAY = 100;

# date as Month-day-Year
$mydate="03-14-2000";
$olddate = $mydate;

$mydate = split("-", $mydate);
$newdate = date( "m-d-Y", mktime(0,0,0,$mydate[0],$mydate[1]+$MOREDAY,$mydate[2]) );

print "$olddate - $newdate";
?>
0
 

Author Comment

by:qader99
ID: 2619295
Thank you ver much
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

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

759 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

26 Experts available now in Live!

Get 1:1 Help Now