UTime custom check?

Okay, so i am using DarkRP, and would like to make etc. You need 2 hours of playtime to become a police officer. (Using UTime if possible) How would i make that?

Well, save unixtime when player joins, then save unixtime when player disconnects.
Do comparison (leaveTime - joinTime) between both and store it in a sql database.