var x = new Date(); var now = x.getTime(); var gmt = 1268180845 * 1000; var diffms = (now - gmt);