var exp=new Date();
setTime(a毫秒):從1970年1月1日午夜到設(shè)置的日期已經(jīng)走了a毫秒。
例如:
var exp=new Date();
exp.setTime(3000)//設(shè)置為exp的日期為:從1970.1.1開始已經(jīng)走了3000毫秒
var exp=new Date();
console.log(exp.toGMTString())
exp.setTime(24*60*60*1000)//設(shè)置為exp的日期為:從1970.1.1開始已經(jīng)走了24*60*60*1000毫秒,即走了一天
//則exp為exp.toGMTString()
console.log(exp.toGMTString())

1.png
getTime():獲取970年1月1日午夜到exp的毫秒數(shù)。
延伸
cookie的expires的正確用法
https://blog.csdn.net/xuchanghao/article/details/5865928
js獲取cookie
https://jingyan.baidu.com/article/9113f81b1784f52b3214c713.html##1