My idea is to make log-in and log-out scripts to capture the login/logout time and save it to a file (or into a Database). But, i have no idea how to capture the time.
The easiest thing to do - that I would do to collect the most potentially relevant information - is to create batch scripts with the following lines (and place the batch scripts in Group Policy logon and logoff scripts - with .cmd extensions)
echo %username% logged on from %computername% on %date% at %time%>>\server\share\logon.log
and for logout:
echo %username% logged off from %computername% on %date% at %time%>>\server\share\logoff.log
(You can use the same file and don't need to separate them, but for convenience, I split them into two files).
The above should append a line to the files logon.log or logoff.log (as appropriate) with the user's account name, the computer that the user logged in from, and the date and time.
By opening the file in excel and using the text-to-columns feature, you can easily create sortable reports. (And you can leave off the text simplifying the logged data into something like echo %username%,%computername%,%date%,%time%)
If you are planning to do this with scripts you can easily assign a VBS script to be run on logon in either Active Directory or Group Policy and just write login time, server name and user to a SQL Database.