此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主【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 %
楼主加油
解决方案 »
- 放在url中的参数对页面内容有影响怎么办?
- 跨页面控制问题
- xhtml网页哪里有呀,这项技术已经使用在哪里呢?
- 求一JS菜单
- var oID = eval("window.document.all."+toolTipLayer);缺少标识符,谁能告诉我错在哪里,应该怎么改.
- 请问JAVASCRIPT中,我想把传进来的字符串根据每10个字符就插入一个\n,请问如何做?
- 如何取得对象到页面顶部及左边的距离???
- 新手问问题,大家多帮忙!(100分)谢谢
- 请教JavaScript高手
- 执行JS函数后滚动条位置问题,这个问题折腾很久了,大家帮帮忙?
- 有没有办法判断浏览器是否支持position的值可以为fixed?
- 关于javascript的url截取问题希望高手帮忙
你要获取什么时间?
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")
一句话就搞定了