since you mentioned that you would use IDs for the players, perhaps you are using (My)SQL for your saves
use dbExec to insert or update a database column, dbQuery and dbPoll to get the results, use os.date() to retrieve the exact date and time (it's using servers time)
or..
use getPlayerAccount, setAccountData and os.date() to set an accounts last login data
then use getPlayerFromName, getPlayerAccount and getAccountData for /lastlogin