js获取当前天00:00:00时间戳和23:59:59的时间戳

 const start = new Date(new Date().toLocaleDateString()).getTime();
 console.log(start);

const end = new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1;
console.log(end); 
 
new Date() ; 将时间戳转换成日期格式         
getTime();将日期转换成时间戳
 

//Mon Dec 04 2017 00:00:00 GMT+0800 (中国标准时间)

//Mon Dec 04 2017 23:59:59 GMT+0800 (中国标准时间)

posted @ 2019-11-04 15:00  清明|雨上  阅读(4944)  评论(0)    收藏  举报