使用js来显示和更新用户的生日 var strTime = "";
if (data["Birthday"] != null) {
var now = eval('new' + data["Birthday"].replace(/\//g, ' '));
strTime = now.getYear() + "-";
strTime += (now.getMonth() + 1) + "-";
strTime += now.getDate() + " ";
strTime += now.getHours() + ":";
strTime += now.getMinutes() + ":";
strTime += now.getSeconds();
}
else {
strTime = "";
}
当时大于或等2000年的时候一切正常。
如果时间是小于2000,strTime得到的数据不是正常而是小了一截
比如 在数据库的时间是1985-8-5
当显示在页面的他是85-8-5
为什么会少了前面的19如果
if (data["Birthday"] != null) {
var now = eval('new' + data["Birthday"].replace(/\//g, ' '));
strTime = now.getYear() + "-";
strTime += (now.getMonth() + 1) + "-";
strTime += now.getDate() + " ";
strTime += now.getHours() + ":";
strTime += now.getMinutes() + ":";
strTime += now.getSeconds();
}
else {
strTime = "";
}
当时大于或等2000年的时候一切正常。
如果时间是小于2000,strTime得到的数据不是正常而是小了一截
比如 在数据库的时间是1985-8-5
当显示在页面的他是85-8-5
为什么会少了前面的19如果
使用json的数据格式~<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">[{"Birthday":"\/Date(484070400000+0800)\/","Blog":"blgos","CityID":2,"Email":null,"Introduction":"一句话","MSN":"123456","NickName":"QQ","QQ":"123456","Sex":"0","TrueName":"2"}]</string>
var now = eval('new' + data["Birthday"].replace(/-/g, '/'));strTime = now.getFullYear() + "-";
var now = eval('new' + data["Birthday"].replace(/\//g, ' '));
strTime = now.getFullYear() + "-";
如何控制他?貌似那个类没有相应的方法!
TimeSpan s = d - DateTime.ParseExact("1970-1-1", "yyyy-M-d", null);
Response.Write(s.TotalMilliseconds);s.TotalMilliseconds传递回来js里<script type="text/javascript">
var s = new Date(492307200000)
alert( s)
</script>