djones Posted March 10, 2006 Share Posted March 10, 2006 I'm pulling $date_created from the database. It is in this format: March-10-2006-10-55-22. I need to echo the $date_created plus 5 days from it. All works ok BUT I need to keep the original hours, minutes, and seconds. How can I do this? How do I add variables into the mktime below?[code]echo "Date Created: ".$date_created."<br />";$split_date = split("-", $date_created);//EX of $date_created :: date("F-j-Y-g-i-s") = March-10-2006-10-55-22$second = $split_mydate[5]; // :22$minute = $split_mydate[4]; // :15:$hour = $split_mydate[3]; // 10:$year = $split_mydate[2]; // 2006$day = $split_mydate[1]; // 10$month = $split_mydate[0]; // March//Need to keep the original hours, minutes, and seconds from above. How do I add it in mktime?$tomm = date("F-j-Y-g-i-s", mktime(0, 0, 0, date("m"), date("d")+5, date("Y")));echo "<br/>".$tomm;[/code] Quote Link to comment https://forums.phpfreaks.com/topic/4626-date-comparison-help-wth-mktime/ Share on other sites More sharing options...
djones Posted March 10, 2006 Author Share Posted March 10, 2006 I finally figured it out. Please close. Quote Link to comment https://forums.phpfreaks.com/topic/4626-date-comparison-help-wth-mktime/#findComment-16191 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.