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