一般情况下,未对日期数据进行格式化处理都是上图的样式。
解决方法:
采用函数Date format
let time = [时间,时间]
new Date(this.time[0]).format('yyyy-MM-dd hh:mm:ss')
(new Date()).Format("yyyy-MM-dd hh:mm:ss") ==> 2021-06-30 00:00:00
(new Date()).Format("yyyy-M-d h:m:s") ==> 2021-6-30 0:0:0
通过上面的格式化:
数据就可以变成我们想要的样子了