refiking Posted September 17, 2008 Share Posted September 17, 2008 I want to find the year of the next month using strtotime. I already got the month, but I need the year of the following month, in the event the month is January. Here's the code I have so far: $nmonth = strtotime('+1 Month'); $nmyear = Quote Link to comment https://forums.phpfreaks.com/topic/124734-solved-finding-the-year-using-strtotime/ Share on other sites More sharing options...
F1Fan Posted September 17, 2008 Share Posted September 17, 2008 strtotime() will return a timestamp. Do this: $timestamp = strtotime('+1 month'); $nmonth = date('m',$timestamp); $nmyear = date('Y',$timestamp); Quote Link to comment https://forums.phpfreaks.com/topic/124734-solved-finding-the-year-using-strtotime/#findComment-644303 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.