mirror of
https://gitee.com/java110/PropertyApp.git
synced 2026-06-11 06:07:28 +08:00
日期格式化bug
This commit is contained in:
parent
9a7ff0d166
commit
afb2d325e5
@ -36,11 +36,11 @@ const formatDate = date => {
|
|||||||
|
|
||||||
const getDate = function getDate(strDate) {
|
const getDate = function getDate(strDate) {
|
||||||
var st = strDate;
|
var st = strDate;
|
||||||
var a = st.split(" "); //这个根据你的字符串决定,如果中间为T则改T
|
var a = st.split(" "); // 分割日期和时间部分
|
||||||
|
|
||||||
var b = a[0].split("-");
|
var b = a[0].split("-"); // 分割年、月、日
|
||||||
var c = a[1].split(":");
|
var c = a[1].split(":"); // 分割时、分、秒
|
||||||
var date = new Date(b[0], b[1], b[2], c[0], c[1], c[2]);
|
var date = new Date(b[0], b[1] - 1, b[2], c[0], c[1], c[2]); // 月份减1
|
||||||
return date;
|
return date;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user