优化代码
This commit is contained in:
@@ -91,7 +91,7 @@
|
||||
const hour = date.getHours(); // 获取小时
|
||||
const minute = date.getMinutes(); // 获取分钟
|
||||
const second = date.getSeconds(); // 获取秒数
|
||||
const formattedDate = `${year}-${month}-${day} ${hour}:${minute}:${second}`; // 拼接成格式化后的日期字符串
|
||||
const formattedDate = `${year}-${month}-${day} ${hour.length==1? '0'+hour:hour}:${minute.length==1? '0'+minute:minute}:${second.length==1? '0'+second:second}`; // 拼接成格式化后的日期字符串
|
||||
return formattedDate
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user