MrXander Posted August 14, 2007 Share Posted August 14, 2007 Hi there, can someone show me a way of taking away say, five minutes from the current time? To explain, I want to show users active in the last 5 minutes, and when their last action was. I have done it all apart from limiting their last action to display... All last actions are a unix timestamp. All I need to know is how to take away 5 minutes... Quote Link to comment https://forums.phpfreaks.com/topic/64894-solved-question-about-time/ Share on other sites More sharing options...
uwannadonkey Posted August 14, 2007 Share Posted August 14, 2007 i would try mktime, it lets you set the time google it Quote Link to comment https://forums.phpfreaks.com/topic/64894-solved-question-about-time/#findComment-323749 Share on other sites More sharing options...
d22552000 Posted August 14, 2007 Share Posted August 14, 2007 uh... $time = time() - 300; I don't know if that's what you want, but that would set the variable TIME with time that is 5 minutes old. Quote Link to comment https://forums.phpfreaks.com/topic/64894-solved-question-about-time/#findComment-323750 Share on other sites More sharing options...
wildteen88 Posted August 14, 2007 Share Posted August 14, 2007 You could also use strtotime too: strtotime("-5minutes"); Quote Link to comment https://forums.phpfreaks.com/topic/64894-solved-question-about-time/#findComment-323756 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.