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? Link to comment https://forums.phpfreaks.com/topic/148062-solved-simple-time-question/ 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... Link to comment https://forums.phpfreaks.com/topic/148062-solved-simple-time-question/#findComment-777148 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; Link to comment https://forums.phpfreaks.com/topic/148062-solved-simple-time-question/#findComment-777158 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... Link to comment https://forums.phpfreaks.com/topic/148062-solved-simple-time-question/#findComment-777160 Share on other sites More sharing options...
phpretard Posted March 5, 2009 Author Share Posted March 5, 2009 Thanks! Link to comment https://forums.phpfreaks.com/topic/148062-solved-simple-time-question/#findComment-777162 Share on other sites More sharing options...
ILMV Posted March 5, 2009 Share Posted March 5, 2009 No problem ILMV Link to comment https://forums.phpfreaks.com/topic/148062-solved-simple-time-question/#findComment-777170 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.