I store timestamps of interactions with clients by using time()
in my PHP code, i want all my clients to be able to know how much time passed between the last interaction of any client with the server to current time (with no timezone offset or whatever).
I use JavaScript on the client side, and I tried using this code :
new Date().getTime()-new Date(interactionXML.find("time").text()*1000).getTime()
where interactionXML.find("time").text()
returns the exact value that the PHP code stored (given by time()), this code outputs values with deviation of about 8 minutes...