vue表格中如何处理此种类型的时间格式
<template>
<el-table border height="calc(100vh - 172px)" style="width: 100%; text-align: center; padding: 0" class="history" :data="tableData" >
<el-table-column prop="NORMSTARTTIME" label="启用时间" :formatter="NORMSTARTTIMEfilter"/>
</el-table>
</template>
<script>
export default {
data () {
return {
tableData: [{NORMSTARTTIME:'2023-02-10T08:06:35.000+00:00'}],
}
},
created () {},
methods: {
// 表格数据重写
NORMSTARTTIMEfilter (row, column) {
// 转换后台返回时间格式
const jsonDate = new Date(row.NORMSTARTTIME).toJSON()
return new Date(new Date(jsonDate) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
},
}
}
</script>