asp.net C# 如何显示时间 要秒跳动显示的那种?

 我来答
57涛
2008-10-08 · 超过12用户采纳过TA的回答
知道答主
回答量:73
采纳率:50%
帮助的人:22万
展开全部
<html>
<head>
<script type="text/javascript">
function startTime()
{
var today=new Date()
var h=today.getHours()
var m=today.getMinutes()
var s=today.getSeconds()
// add a zero in front of numbers<10
m=checkTime(m)
s=checkTime(s)
document.getElementById('txt').innerHTML=h+":"+m+":"+s
t=setTimeout('startTime()',500)
}

function checkTime(i)
{
if (i<10)
{i="0" + i}
return i
}
</script>
</head>
显示动态时间<br>
<body onload="startTime()">
<div id="txt"></div>

<script type="text/javascript">
var d=new Date()
var weekday=new Array(7)
weekday[0]="Sunday"
weekday[1]="Monday"
weekday[2]="Tuesday"
weekday[3]="Wednesday"
weekday[4]="Thursday"
weekday[5]="Friday"
weekday[6]="Saturday"
document.write("Today it is " + weekday[d.getDay()])
</script>
<br>
将当前日期转换成字符串<br>
<script type="text/javascript">
var d = new Date()
document.write (d.toUTCString())
</script>

</body>
</html>
乘贤归鹏云
2020-05-12 · TA获得超过3822个赞
知道大有可为答主
回答量:3084
采纳率:29%
帮助的人:279万
展开全部
<html>
<head>
<script
type="text/javascript">
function
startTime()
{
var
today=new
Date()
var
h=today.getHours()
var
m=today.getMinutes()
var
s=today.getSeconds()
//
add
a
zero
in
front
of
numbers<10
m=checkTime(m)
s=checkTime(s)
document.getElementById('txt').innerHTML=h+":"+m+":"+s
t=setTimeout('startTime()',500)
}
function
checkTime(i)
{
if
(i<10)
{i="0"
+
i}
return
i
}
</script>
</head>
显示动态时间<br>
<body
onload="startTime()">
<div
id="txt"></div>
<script
type="text/javascript">
var
d=new
Date()
var
weekday=new
Array(7)
weekday[0]="Sunday"
weekday[1]="Monday"
weekday[2]="Tuesday"
weekday[3]="Wednesday"
weekday[4]="Thursday"
weekday[5]="Friday"
weekday[6]="Saturday"
document.write("Today
it
is
"
+
weekday[d.getDay()])
</script>
<br>
将当前日期转换成字符串<br>
<script
type="text/javascript">
var
d
=
new
Date()
document.write
(d.toUTCString())
</script>
</body>
</html>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式