function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
saharisahari 

Login Hours from Apex

Hi

 

I have a requirement to monitor all the users login hours. Everyday, the first time they login to salesforce, I need to record their timings. 

Does any one have an idea on this?

 

Thanks for any help!

mtbclimbermtbclimber

There is a lastlogindate field on User which you can query but there is no way to know when they logged out.  There is also a login history feature that may help under setup > administration setup > manage users > login history