此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主【jcplus】截止到2008-07-02 09:28:49的历史汇总数据(不包括此帖):
发帖的总数量:3 发帖的总分数:60
结贴的总数量:2 结贴的总分数:40
无满意结贴数:0 无满意结贴分:0
未结的帖子数:1 未结的总分数:20
结贴的百分比:66.67 % 结分的百分比:66.67 %
无满意结贴率:0.00 % 无满意结分率:0.00 %
楼主加油
楼主【jcplus】截止到2008-07-02 09:28:49的历史汇总数据(不包括此帖):
发帖的总数量:3 发帖的总分数:60
结贴的总数量:2 结贴的总分数:40
无满意结贴数:0 无满意结贴分:0
未结的帖子数:1 未结的总分数:20
结贴的百分比:66.67 % 结分的百分比:66.67 %
无满意结贴率:0.00 % 无满意结分率:0.00 %
楼主加油
你要获取什么时间?
var d = new Date(ms)
var str = d.getHours()+":"+d.getMinutes()+":"+d.getSeconds()+" "+(d.getMonth()+1)+"-"+d.getDay()+"-"+d.getFullYear()
alert(str)
<html>
<head>
<script>
/**
* 时间对象的格式化;
*/
Date.prototype.format = function(format){
/*
* eg:format="YYYY-MM-dd hh:mm:ss";
*/
var o = {
"M+" : this.getMonth()+1, //month
"d+" : this.getDate(), //day
"h+" : this.getHours(), //hour
"m+" : this.getMinutes(), //minute
"s+" : this.getSeconds(), //second
"q+" : Math.floor((this.getMonth()+3)/3), //quarter
"S" : this.getMilliseconds() //millisecond
}
if(/(y+)/.test(format)) {
format = format.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
}
for(var k in o) {
if(new RegExp("("+ k +")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));
}
}
return format;
}
</script>
<script>
var now = new Date();
var ms = now.getTime();
alert(new Date(ms).format("hh:mm MM-dd-yyyy"));
</script>
</head>
<body>
</body>
</html>
通过设置格式 "hh:mm MM-dd-yyyy" 来实现时间的格式化
时间是 11:20 07-02-2008
就是得到当前时间
var ms = now.getTime();
alert(new Date(ms).format("hh:mm MM-dd-yyyy"));
可以精简为一行
alert(new Date().format("hh:mm MM-dd-yyyy"));
new Date().format("hh:mm MM-dd-yyyy")
一句话就搞定了