Solved

problem with dates

Posted on 2000-03-13
2
222 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

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.  …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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.

690 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