• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 194
  • Last Modified:

difference between login time and logout time?

i have to tried displaying login time and logout time from database.now  i am getting hours only and minutes,seconds didn't displayed from database.


This is my link.
  • 2
1 Solution
Ray PaseurCommented:
There is no time display - that link asks for authentication.  Maybe these learning resources can help.

Here is how to handle date and time in PHP and MySQL:

In a nutshell, you want to define your database columns as DATETIME.  In some cases you can use TIMESTAMP.  These definitions are documented in the MySQL manual.  Then you want to store values in the DATETIME columns by using the ISO-8601 date format (the article explains it).  

You can know the client login time.  But unless your client is cooperative and specifically logs out via a script on your server, you cannot know the "logout" time.  For example, ask yourself whether I am logged in to Experts-Exchange right now?  I might be, or I might have left to get coffee and E-E "logged me out" for inactivity.  So trying to get the exact time for a "logout" event is not really a good design principle.  Because HTTP client/server is a stateless protocol, there really is no such thing as a "logged in" user.
Is this in Crystal?

Is the field a datetime field?

Ray PaseurCommented:
Why the bad grade?  The question gave us a link that did not work, and we pointed that out more than a month ago.

Please read the grading guidelines then explain why you gave a marked-down grade without any questions or explanation!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now