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