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 Link to comment https://forums.phpfreaks.com/topic/95587-adding-days-onto-a-specific-date/ 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 Link to comment https://forums.phpfreaks.com/topic/95587-adding-days-onto-a-specific-date/#findComment-489328 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! Link to comment https://forums.phpfreaks.com/topic/95587-adding-days-onto-a-specific-date/#findComment-489332 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.