Often I find myself wanting to generate a date in the future, for instance, this time next year. Using the single function below I am able to achieve that.

// Get date in the future by adding months
function getFutureDate($add_months = 12){
	return date('d/m/Y',strtotime(date("d-m-Y", time()) . " + " . $add_months . " months"));
}

Published by Dragos Micu

WooCommerce

Leave a Reply

Your email address will not be published. Required fields are marked *