element时间组件 数据格式化||yyyy-MM-dd HH:mm:ss

const data={
                    name:this.ruleForm.name,
                    startTime:`${this.ruleForm.startTime.getFullYear()}-${this.ruleForm.startTime.getMonth() + 1}-${this.ruleForm.startTime.getDate()} ${this.ruleForm.startTime.getHours()}:${this.ruleForm.startTime.getMinutes()}:${this.ruleForm.startTime.getSeconds()}`,
                    endTime:`${this.ruleForm.endTime.getFullYear()}-${this.ruleForm.endTime.getMonth() + 1}-${this.ruleForm.endTime.getDate()} ${this.ruleForm.endTime.getHours()}:${this.ruleForm.endTime.getMinutes()}:${this.ruleForm.endTime.getSeconds()}`,
                }

 

posted @ 2022-12-14 11:47  肥晨  阅读(47)  评论(0编辑  收藏  举报