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. Quote 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')); Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.