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 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")); ?> 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); ?> Link to comment https://forums.phpfreaks.com/topic/56638-add-days-to-date/#findComment-279946 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.