in reply to Server time vs computer logging in

There is no need for time zones in this calculation at all. Store the last seen time either in the server's time zone or better in UTC (like UNIX timestamps), and make sure that the current time is in that same time zone. Then just subtract the last seen time from the current time, as you've already been shown in previous threads.

There is also no need to muck around with strings as much as you are, but if you insist, then at least use the appropriate functions (strftime and strptime) instead of building them yourself, and make sure to always include the time zone information in the strings.