被Json格式化后那可怜的时间
function renderTime(date) { var da = new Date(parseInt(date.replace("/Date(", "").replace(")/", "").split("+")[0])); Year = da.getFullYear(); //ie火狐下都可以 Month = da.getMonth() + 1; Day = da.getDate(); var CurrentDate = ""; CurrentDate += Year + "-"; if (Month >= 10) { CurrentDate += Month + "-"; } else { CurrentDate += "0" + Month + "-"; } if (Day >= 10) { CurrentDate += Day; } else { CurrentDate += "0" + Day; } return CurrentDate + " " + da.getHours() + ":" + da.getSeconds() + ":" + da.getMinutes(); }
本文来自博客园,作者:大楚打码人,转载请注明原文链接:https://www.cnblogs.com/qh1688/p/4981423.html