var servertime = new Date(1268223151000); var clienttime = new Date(); var offset = clienttime.getTime() - servertime.getTime();