0
我在ISO格式得到日期使用moment.js设置部分时间为0 ISO日期格式:使用moment.js
let matchDate= moment().add(1, 'day').toISOString();
它给我matchDate形式:
2017-08-01T18:30:00.000Z
我想成立后T每个数值为0,得到的结果作为
2017-08-01T00:00:00.000Z
我怎样才能做到这一点?
在这一点上,它只是一个字符串,所以你可以将字符串切分为10个字符并添加“T00:00:00.000Z”。即'matchDate.slice(0,10)+“T00:00:00.000Z”' –