首页 > Web开发 > 详细

moment.js 时间戳转换

时间:2018-06-22 16:03:14      阅读:956      评论:0      收藏:0      [点我收藏+]

 

2018-03-15 00:00:00 ~ 2018-03-21 00:00:00

 

let startTime = moment(‘2018-03-15‘).format(‘x‘)

let endTime = moment(‘2018-03-21‘).format(‘x‘)  //零点时间

console.log(‘start‘,startTime)

console.log(‘end‘,endTime)

 

 

一星期的时间范围:

2018-03-19 00:00:00  ~ 2018-03-21 23:59:59

 

startTime: moment().subtract(8, ‘days‘).startOf(‘day‘).valueOf(),

endTime: moment().subtract(1, ‘days‘).endOf(‘day‘).valueOf(),

moment.js 时间戳转换

原文:https://www.cnblogs.com/aloehui/p/9213741.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!