Adding a year onto date()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Adding a year onto date()

Post by Joe »

I was wondering how I could add a year onto my current date function which is:

Code: Select all

$date = date("F j, Y");
Its for an expiry password like the year is 2004, I want it to be 2005 stamped into the database. (the best I can explian) :O
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

date("F j, Y",time() + 365 * 24 * 60 * 60);
or similar
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Ahh thanks alot bud!
Post Reply