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

猜你喜欢

转载自www.cnblogs.com/aloehui/p/9213741.html