我在类里面的时间是"2013-09-22 00:00:00.0"这样的,
转换成json就变成这样的了..怎么样才能让他正常显示回来?
------解决方案--------------------
把createtime做为参数传进去就好了
function dateFormat(time){
if(!time){
return "";
}
var tmp = eval(time);
var date = new Date();
date.setTime(tmp.time);
var year = date.getYear();
var month = date.getMonth() + 1;
var day = date.getDate(); //获取当前日(1-31)
/*var hour = date.getHours(); //获取当前小时数(0-23)
var minute = date.getMinutes(); //获取当前分钟数(0-59)
var second = date.getSeconds(); //获取当前秒数(0-59)*/
month=month<10?("0"+month):month;
day=day<10?("0"+day):day;
/*hour=hour<10?("0"+hour):hour;
minute=minute<10?("0"+minute):minute;
second=second<10?("0"+second):second;*/
var dateStr = year + "-" + month + "-" + day;
//dateStr = dateStr + " " + hour + ":" + minute + ":" + second;
return dateStr;
}