php - calculate end date from duration -


i have duration drop down menu options 'yearly/quarterly/monthly' , start date textbox datepicker. there textbox end_date.

based on duration need end date when duration , start date selected.

e.g.: start date 23-09-2015 , duration chosen 3 months so, need display 23-12-2015.but have no idea how that.

try this. example. hope help.

<?php $date = date("y-m-d");  $date = strtotime(date("y-m-d", strtotime($date)) . " +3 month"); echo date("y-m-d",$date); ?> 

if need add months , date this

$date = strtotime(date("y-m-d", strtotime($date)) . " +3 month 2 day"); 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -