calculate time.

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
nickchou
Forum Newbie
Posts: 6
Joined: Sat Aug 25, 2007 1:53 pm

calculate time.

Post by nickchou »

I use $time=date("Y-m-d"); to get current time.
How can I get the expiry date($expiry) which is 1 month later?

Thanks a lot!...
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Post by aceconcepts »

Code: Select all

date("Y-m-d", strtotime($expiry))
http://uk.php.net/strtotime
User avatar
xpgeek
Forum Contributor
Posts: 146
Joined: Mon May 22, 2006 1:45 am
Location: Kyiv, Ukraine
Contact:

Post by xpgeek »

Also you can use date and mktime.
http://php.net/mktime
Post Reply