elentz Posted November 14, 2007 Share Posted November 14, 2007 How can I take a date and add a set amount of days to it. What I am after is I have a CRM system that will generate the date of an invoice, I want to have a new field to add 10 days to that date. IE Invoice date 10-1-2007 and the Due date 10-11-2007. Thanks! Link to comment https://forums.phpfreaks.com/topic/77377-adding-a-number-of-days-to-a-date/ Share on other sites More sharing options...
pocobueno1388 Posted November 14, 2007 Share Posted November 14, 2007 $date = date('Y-m-d', strtotime("+10 days")); EDIT: If you want to add days to a specific date, then you can do this <?php $date = strtotime("2007-11-14"); $date = date('Y-m-d', strtotime("10 day", $date)); echo $date; ?> Link to comment https://forums.phpfreaks.com/topic/77377-adding-a-number-of-days-to-a-date/#findComment-391717 Share on other sites More sharing options...
elentz Posted November 15, 2007 Author Share Posted November 15, 2007 Would that work with a variable ? Instead of the static date? Thanks Link to comment https://forums.phpfreaks.com/topic/77377-adding-a-number-of-days-to-a-date/#findComment-391898 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.