将时钟添加到网站 [英] Add clock to website

查看:119
本文介绍了将时钟添加到网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的网站上添加时钟(时间).我正在与Visual Studio 2005合作,使用任何javascript或html或asp .net代码都将有所帮助
谢谢

I want to add clock (time) to my web site. I am working with visual studio 2005 any javascript or html or asp .net codes would be helpful
Thanks

推荐答案

令人惊讶的是,这已经完成了!
更令人惊讶的是,那里有一个工具可以帮助您找到这样的东西!
Google使用您的主题行 [ ^ ]
Surprisingly, this has been done before!
Even more amazingly, there is a tool out there that helps you find such things!
Google using your subject line[^]


嗨 该代码是一个时钟,并根据服务器时间进行更改

Hi this code a clock and change by server time

<script language="JavaScript">
<!-- Begin
function showMilitaryTime() {
if (document.form.showMilitary[0].checked) {
return true;
}
return false;
}
function showTheHours(theHour) {
if (showMilitaryTime() || (theHour > 0 && theHour < 13)) {
if (theHour == "0") theHour = 12;
return (theHour);
}
if (theHour == 0) {
return (12);
}
return (theHour-12);
}
function showZeroFilled(inValue) {
if (inValue > 9) {
return "" + inValue;
}
return "0" + inValue;
}
function showAmPm() {
if (showMilitaryTime()) {
return ("");
}
if (now.getHours() < 12) {
return (" am");
}
return (" pm");
}
function showTheTime() {
now = new Date
document.form.showTime.value = showTheHours(now.getHours()) + ":" + showZeroFilled(now.getMinutes()) + ":" + showZeroFilled(now.getSeconds()) + showAmPm()
setTimeout("showTheTime()",1000)
}
</script>

->


我有我即将发送给您的代码

这是javascript

我们可以通过``settimeout()''函数获取时间

尝试处理剩余的
i have that code i will send u soon

which is javascript

we can acieve time by ''settimeout()'' function

try to work on remaining


这篇关于将时钟添加到网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆