var EndTime = new Date('2014/12/20 00:00:00');
var NowTime = new Date();
var t = EndTime.getTime() - NowTime.getTime();
var d = Math.floor(t/1000/60/60/24); // 天
var h = Math.floor(t/1000/60/60%24); // 小时
var m = Math.floor(t/1000/60%60); // 分钟
var s = Math.floor(t/1000%60); //秒
其他相关资料 lishengzxc/bblog/issues/5 Calculating Dates and Times (JavaScript)