菜鸟求教:在网页中添加一个时钟,有这样控件吗,

firstboy 2004-04-09 07:12:24
在网页中添加一个时钟,有这样控件吗,内容为“*年*月*日*时*分*秒”有这样的控件吗,如果自己写语句,怎么写呢
...全文
174 点赞 收藏 6
写回复
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
张海霖 2004-09-23
我也在找如果是activex空间就好了
回复
lystan 2004-04-10
时间是要客户端的,还是服务端的啊
一般客户端的就很好办了
回复
HeavenBen 2004-04-10
<script language="javascript">
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours
}
if (hours==0)
hours=00
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate="<font color='6e6e6e' face='Arial' size=1><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn
+"</b></font>"
if (document.all)
document.all.clock.innerHTML=cdate
else
document.write(cdate)
}
if (!document.all)
getthedate()
function goforit(){
if (document.all)
setInterval("getthedate()",1000)
}
window.onload=goforit
</script>
回复
firstboy 2004-04-09
对不起,这样不能给分,版主我这贴怎么处理呀??
回复
efei 2004-04-09
要显示时间做什么?用户机子上又不是没有
回复
jingfeng198 2004-04-09
網上多的是阿
回复
发动态
发帖子
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
社区公告
暂无公告