Hello, I will go over this one step at a time, looking at the documentation for get_login_by_id I can see the documentation here : https://docs.q2developer.com/
Inside this docs it is calling stored procedure sdk_GetLoginByUserID Which looking at the sdk code is the file: code.q2developer.com. Which we can see doesn't apply any sorts so it will be defaulted to by the primary key. This is looking at the table dbo.Q2_UserLogon. Which inside this table is a column called LastLogon which is probably the piece of data you are looking for.
You could also just call the function with the appropriate data and see what you get back.