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