优化代码

This commit is contained in:
wuxw 2023-10-08 10:53:26 +08:00
parent d77aa2c1f4
commit 3cb4592eb3

View File

@ -70,7 +70,8 @@ export function getDate(strDate) {
var a = st.split(" "); //这个根据你的字符串决定如果中间为T则改T
var b = a[0].split("-");
var c = a[1].split(":");
var date = new Date(b[0], b[1], b[2], c[0], c[1], c[2]);
let month = parseInt(b[1])-1;
var date = new Date(b[0], month, b[2], c[0], c[1], c[2]);
return date;
};