Code to display "next" year dynamically in PHP

Hello,

I'm converting a script from Coldfusion to PHP.  One of the lines of code dynamically returns "next" year.

In Coldfusion, the code is #DateFormat(DateAdd('YYYY',1,now()),"YYYY")#

What is the PHP equivalent?  So at the time of this writing, it would return "2016".

Thanks in advance.
benjaminfamAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gr8gonzoConsultantCommented:
Check out this good article on date/time handling in PHP. It should give you your answer and help you with the conversion process.

http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html
0
Radek BaranowskiFull-stack Java DeveloperCommented:
<?php

echo date("Y")+1;

?>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gr8gonzoConsultantCommented:
Radek is correct, but I was trying to teach you how to fish. :) Please read through that article - it will give you a lot more insight into what you can do with date/time in PHP than just next year. If you're converting an application, it's pretty vital information.
0
Radek BaranowskiFull-stack Java DeveloperCommented:
upvoting what gonzo said. :)
0
benjaminfamAuthor Commented:
Thank you both.  This was very helpful.   I do know how to fish, but sometimes circumstances just  necessitate a quick answer.  I had actually done some "fishing" yesterday, but was over complicating it a bit apparently by trying to use the mktime() function in conjunction with the date() function.   I appreciate the simplicity that you offered and I do in fact appreciate the link and will read it in its entirety as it's ultimately my desire to grow in my knowledge and understanding.  Sometimes time is of the essence thought.  :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.