phpretard Posted March 5, 2009 Share Posted March 5, 2009 I am setting up a 30 day free trial and would like to display the remaining days in text. IE: You have XXX days left in your trial. $thisPost="1236251176" //according to time() How can I add 30 days to $thisPost? Quote Link to comment Share on other sites More sharing options...
ILMV Posted March 5, 2009 Share Posted March 5, 2009 time() + (60 * 60 * 24 * 30) seconds * minutes * hours * days I haven't tested, see what that does... Quote Link to comment Share on other sites More sharing options...
phpretard Posted March 5, 2009 Author Share Posted March 5, 2009 Using the below Displays a number. How do I tranlate that number into text? $now=time(); $trial=time() + (60 * 60 * 24 * 30); echo $now-$trialtime; Quote Link to comment Share on other sites More sharing options...
ILMV Posted March 5, 2009 Share Posted March 5, 2009 use the date() function... echo date('l jS \of F Y h:i:s A', $trial); Just change the first argument as documented to display what you want... Quote Link to comment Share on other sites More sharing options...
phpretard Posted March 5, 2009 Author Share Posted March 5, 2009 Thanks! Quote Link to comment Share on other sites More sharing options...
ILMV Posted March 5, 2009 Share Posted March 5, 2009 No problem ILMV 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.