Solved

problem with dates

Posted on 2000-03-13
2
210 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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 how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
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…

749 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