proctk Posted June 22, 2007 Share Posted June 22, 2007 Hi I have a date assigned to a variable $firstPay and another variable $totalDaysTo which has the number of that I want to add to the variable $firstPay to get some future date. I'm not sure how to wright the code for this one any help is excellent Quote Link to comment https://forums.phpfreaks.com/topic/56638-add-days-to-date/ Share on other sites More sharing options...
pocobueno1388 Posted June 22, 2007 Share Posted June 22, 2007 Try this... <?php $firstPay = date("Y-m-d"); $new_date = date ('Y-m-d', strtotime ("$firstPay + $totalDays days")); ?> Quote Link to comment https://forums.phpfreaks.com/topic/56638-add-days-to-date/#findComment-279720 Share on other sites More sharing options...
suma237 Posted June 22, 2007 Share Posted June 22, 2007 Try this <?php $tomorrow = mktime(0, 0, 0, date("m"), date("d")+1, date("y")); echo "Tomorrow is ".date("m/d/y", $tomorrow); ?> Quote Link to comment https://forums.phpfreaks.com/topic/56638-add-days-to-date/#findComment-279946 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.