显示动态时间

10:14:36

Today it is Sunday
将当前日期转换成字符串
Sun, 9 Aug 2009 02:11:38 UTC

<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 >http://zhidao.baidu.com/question/71061731.html?fr=qrl&fr2=query

相关文章:

  • 2022-12-23
  • 2021-05-27
  • 2021-05-25
  • 2021-12-22
  • 2021-12-22
  • 2021-12-22
  • 2021-07-16
  • 2022-02-03
猜你喜欢
  • 2022-12-23
  • 2022-01-18
  • 2022-02-04
  • 2021-11-28
  • 2021-11-13
  • 2022-12-23
相关资源
相似解决方案