
-----------------------------------
Kazz
Sun May 08, 2011 10:38 pm

How long a user is logged in for
-----------------------------------
I need help with this.. I want to be able to keep track of how long a user is 'Logged' into my site. So far i only can get seconds. I subtract logged in time from logged out time and i want days, hours, minutes, seconds, ect.. If anyone has any sugestions it would be greatly apreciated.

-----------------------------------
RandomLetters
Sun May 08, 2011 10:58 pm

RE:How long a user is logged in for
-----------------------------------
Well, minutes = 60 seconds, hours = 60 minutes, and so on.  You can just record in seconds and calculate it when you display it.

-----------------------------------
Zren
Mon May 09, 2011 12:14 am

RE:How long a user is logged in for
-----------------------------------
If you're using php, something like this ought to work.




Look at the DateTime constructor if you're calculating from a unix timestamp.

http://www.php.net/manual/en/datetime.construct.php

-----------------------------------
Kazz
Mon May 09, 2011 8:47 am

Re: How long a user is logged in for
-----------------------------------
Alright i will try something like that.
