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 = 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); 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
Archived
This topic is now archived and is closed to further replies.