How can one know how much time user logged?

Hello,
i know who command gives you the time when particular user logged in. And subtracting today's date and time from the one found in who we can get how much time user logged in. But this can get very much clumsy as we can't subtract date directly in unix . Is there any other way or command through which we can get this info?
Thanks in advance :slight_smile:

Have a look at 'last'

last also doesn't give directly the total time user logged in? it gives just starting and ending time, and i cant subtract date directly like loggedOutTime - loggedInTime. Unix doesn't permit me this. Any other options?

Could you please see below output from LAST comman from my pc

batch ftp o2hp91.uk.pri.o2 Mon Jun 30 12:43 - 12:43 (00:00)
batch pts/4 asst206613.uk.pr Mon Jun 30 12:40 - 09:40 (20:59)
batch pts/3 dasst102938.uk.p Mon Jun 30 11:38 - 10:23 (22:44)
oracle pts/3 lasst205223.uk.p Mon Jun 30 09:06 - 09:10 (00:03)
batch pts/3 asst206613.uk.pr Tue Jun 24 09:26 - 13:42 (1+04:16)
oracle pts/3 lasst205223.uk.p Mon Jun 23 14:19 - 16:06 (01:47)

Already, it's gived calculated time

Please let me know.

Regards,
Divyang

ya you are right divyang. Actually i had to run this command from college to get a better idea. You are right it gives calculated time.