jon_17 Posted September 20, 2006 Share Posted September 20, 2006 Hi all,I want to add 1 month to the current date and echo the result in this format: YYYYmmddHow do I do that and still maintain the validity of the date (i.e if current date is 2006 12 25, then adding 1 month will give me 2007 01 25 not 2006 13 25)Thank you, Quote Link to comment Share on other sites More sharing options...
trq Posted September 20, 2006 Share Posted September 20, 2006 Almost straight from the manual.[code=php:0]$nextmnth = date("Y m d", mktime(0, 0, 0, date("m")+1 , date("d"), date("Y")));[/code] Quote Link to comment 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.