Or, at least dealing with it is what I'm having trouble with.
How can I efficiently measure the difference between timestamps (and which timestamping functions should I use?) and execute conditional code based on those results?
For instance, a pretty simple whoseonline would add usernames to a database table and "DELETE FROM users_online WHERE userid='$userid'" after about 15 minutes of inactivity but how do I do this?
It seems to me it's probably done with an expression that checks for a difference in seconds between $timea and $timeb and, if that time is greater then x, execute the delete query but my lack of knowledge in this particular point envelopes that entire area.
Can someone point me to a resource or supply code to allow me to get a current datetime, turn it into a readable datetime, and compare times in the abovementioned method. A table where I could find the number of seconds in 15 minutes or 1 day would also be useful.
Thanks.