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 Link to comment https://forums.phpfreaks.com/topic/84518-solved-date-help/ 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. Link to comment https://forums.phpfreaks.com/topic/84518-solved-date-help/#findComment-430599 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) Link to comment https://forums.phpfreaks.com/topic/84518-solved-date-help/#findComment-430602 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. Link to comment https://forums.phpfreaks.com/topic/84518-solved-date-help/#findComment-430614 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 Link to comment https://forums.phpfreaks.com/topic/84518-solved-date-help/#findComment-430642 Share on other sites More sharing options...
steviez Posted January 4, 2008 Author Share Posted January 4, 2008 Thanks Ken Great help! Link to comment https://forums.phpfreaks.com/topic/84518-solved-date-help/#findComment-430828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.