pwnuspoints Posted December 9, 2009 Share Posted December 9, 2009 Hello phpfreaks, I'm wondering if anyone knows a simple way to display next months full written name [e.g. January] using a simple date() function? Basically- when it's "December" I want the date to read "January"; when it's "January" I want "February" and so on. Anybody know where I should start looking? Link to comment https://forums.phpfreaks.com/topic/184553-advance-date-by-one-month/ Share on other sites More sharing options...
wildteen88 Posted December 9, 2009 Share Posted December 9, 2009 Use strtotime combined with the date function $time= strtotime("+1 month"); echo 'Current month: ' . date('F') . '<br />'; echo 'Next month: ' . date('F', $time) . '<br />'; Link to comment https://forums.phpfreaks.com/topic/184553-advance-date-by-one-month/#findComment-974317 Share on other sites More sharing options...
Maq Posted December 9, 2009 Share Posted December 9, 2009 There's also a tutorial written on PHP dates here, in case you wanted an extra read: http://www.phpfreaks.com/tutorial/working-with-dates-in-php Link to comment https://forums.phpfreaks.com/topic/184553-advance-date-by-one-month/#findComment-974318 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.