DrTrans Posted September 7, 2009 Share Posted September 7, 2009 I have to dates Begin Date: <?PHP echo date(' jS \of FY h:i A'); ?> End Date: ( Needs to be 12 Months after. so 1 year from current date/time How would my date be setup i tried this <?PHP echo date(' jS \of F+12 Y h:i A'); ?> I am confused. Link to comment https://forums.phpfreaks.com/topic/173432-solved-date-adding-12-months-to-current-date/ Share on other sites More sharing options...
thebadbad Posted September 7, 2009 Share Posted September 7, 2009 You can use strtotime() to create a timestamp one year in the future, feeding it to date() as the second parameter: echo date(' jS \of FY h:i A', strtotime('+ 1 year')); Link to comment https://forums.phpfreaks.com/topic/173432-solved-date-adding-12-months-to-current-date/#findComment-914233 Share on other sites More sharing options...
Adam Posted September 7, 2009 Share Posted September 7, 2009 $year_after = date(' jS \of FY h:i A', strtotime('+1 year')); thebadbad beat me to it! Link to comment https://forums.phpfreaks.com/topic/173432-solved-date-adding-12-months-to-current-date/#findComment-914234 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.