Forum Moderators: coopster
I first tried "next month" but that was skipping a month... not sure why?!?
;)
From the GNU Date input formats:
A few numbers may be written out in words in most contexts. This is most useful for specifying day of the week items or relative items (see below). Here is the list:for 1,'first'for 2,'next'for 3,'third'for 4,'fourth'for 5,'fifth'for 6,'sixth'for 7,'seventh'for 8,'eighth'for 9,'ninth'for 10,'tenth'for 11 and'eleventh'for 12. Also,'twelfth'means exactly -1.'last'
I don't claim to be an expert on the GNU Date input formats [gnu.org], but I believe the way
first, next, third, etc. operates might be translated as follows: The
first month after this month. (Adds 1) next month after the first month after the current month. (Adds 2) third month after that. (Adds 3) Testing I have performed proved the calculations true, I'm just not sure my translation is what the programmers would agree on. But, heh, it works for me ;)
next month is that the function is adding 2 to the current month. Your code would work fine if you stated you wanted to show the first month after the current month, dcrombie:
$month = date("F");
$next = date("F", strtotime("first month"));