steviez Posted January 4, 2008 Share Posted January 4, 2008 Hi, I want to make my users accounts expire one month from the signup date, all my info is stored in mysql and i need php to store the expire date one month from the signup date. How is this done? Thanks Quote Link to comment Share on other sites More sharing options...
duclet Posted January 4, 2008 Share Posted January 4, 2008 $date = 'January 4, 2008' $future = strtotime($date.' +1 month'); That would return the Unix Timestamp. Not fully sure if it works though, just something that came to my head. Quote Link to comment Share on other sites More sharing options...
Barand Posted January 4, 2008 Share Posted January 4, 2008 INSERT INTO users (signup_date, expiry_date) VALUES (CURDATE(), CURDATE+INTERVAL 1 MONTH) Quote Link to comment Share on other sites More sharing options...
steviez Posted January 4, 2008 Author Share Posted January 4, 2008 $date = 'January 4, 2008' $future = strtotime($date.' +1 month'); That would return the Unix Timestamp. Not fully sure if it works though, just something that came to my head. This is the only one i can get to give me any value but it gives me 2012-02-10 from todays date. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted January 4, 2008 Share Posted January 4, 2008 One month from today: <?php $future = date('Y-m-d',strtotime('+1 month')); echo $future . "<br>\n"; ?> Ken Quote Link to comment Share on other sites More sharing options...
steviez Posted January 4, 2008 Author Share Posted January 4, 2008 Thanks Ken Great help! 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.