moment.js 时间戳转换

 

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(),

文章来自:https://www.cnblogs.com/aloehui/p/9213741.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3