Solarpitch Posted March 11, 2008 Share Posted March 11, 2008 Hey, Just wondering if its possible to add a certain number of days onto a specific date. My date format is eg: 11-03-08. I want to be able to allow the user to select an input which will be a number. This number will take the current date and add that many days onto it. Current Date: 11-03-08 User enters 3 days New Date: 14-03-08 Quote Link to comment Share on other sites More sharing options...
xyn Posted March 11, 2008 Share Posted March 11, 2008 $days =$_POST['days'] number only. $date =date("Y-m-d",strtotime("+{$_POST['days']} days")); http://php.net/strtotime and/or http://php.net/mktime Quote Link to comment Share on other sites More sharing options...
Solarpitch Posted March 11, 2008 Author Share Posted March 11, 2008 Ah, strtotime().. I couldnt think of the function to do this with. Many Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.