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