Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   session login and logout time (http://www.go4expert.com/forums/session-login-logout-time-t23713/)

divinequran 30Oct2010 07:29

session login and logout time
 
Hi,

I have to calculate login and logout time of an user. I store the session creation and session out time. How do I calculate the minutes or hours user have loged in. Do u have any code snippet for it?

shabbir 30Oct2010 11:09

Re: session login and logout time
 
What is the time storing unit. Is it unix time stamp?

Try this.
Code:

$beginTimeConverted=strtotime($beginTime);
$endTimeConverted=strtotime($endTime);

// perform subtraction
$timeDiff=$endTimeConverted-$beginTimeConverted;


divinequran 1Nov2010 07:42

Re: session login and logout time
 
Thanks, It will help in writing the code.


All times are GMT +5.5. The time now is 22:58.