Hi All, please let us know how to calculate login and logout time(date:hours:minutes:second) in php pages, please give me coding its, we would be appreciated your kind of help.
What details are you storing in the login information, and how are you storing it? There are many ways you can do this, but at lot of it depends on what you are doing at the moment.
thanks for quick reply, I have store time in login and logout (date:hours:minutes:second) our codding as
hiiiiiiiii u can find login and logout time using session variable.for more details u can go to the website w3schools or php.net i hope this will help u. thanks Regards devid
I have calculated login and logout time, but we need difference between both time or logout subtract login time.
As you are storing the login time in a database, you can do this quite simply in a single select using the mysql date/time functions. SELECT TIMEDIFF(logout, login); PHP: Will give you the number of hours/minutes/seconds between the two. It will not count days. E.G (you should get the login time from your stored value) SELECT TIMEDIFF(now(), '2010-04-20 14:12:23'); PHP: OUTPUT: 48:40:58 Its not too hard to represent the number of days, if needed either. Check the SQL time/date functions.