/**
* 改变日期格式
*"2019/01/20 10:15:00";
*/
function changeDateForm(endTime){//20190114195948
if(endTime.length != 14 ){
return "";
}
var year =endTime.substring(0,4);
var month =endTime.substring(4,6);
var date =endTime.substring(6,8);
var hour = endTime.substring(8,10);
var minute = endTime.substring(10,12);
var second =endTime.substring(12,14);
return year + symbol1 + month + symbol1 + date + symbol3 + hour + symbol2 + minute + symbol2 + second;
}
//对象转Json
var toJson = function (obj) {
if (window.JSON) {
return JSON.stringify(obj);
} else {
alert("JSON转换错误!");
return null;
}
};
//返回值Json转对象
var jsonToObj = function (text) {
if (window.JSON) {
return JSON.parse(text);
} else {
return eval("(" + text + ")");
}
};