`
premier_gu
  • 浏览: 10295 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论

js动态显示当前时间

 
阅读更多
<SCRIPT language=JavaScript>
function CurentTime(){
    var now = new Date();
    var hh = now.getHours();
    var mm = now.getMinutes();
    var ss = now.getTime() % 60000;
    ss = (ss - (ss % 1000)) / 1000;
    var clock = hh+':';
    if (mm < 10) clock += '0';
    clock += mm+':';
    if (ss < 10) clock += '0';
    clock += ss;
    return(clock); }
function refreshCalendarClock(){
    document.all.calendarClock4.innerHTML = CurentTime(); }
    setInterval('refreshCalendarClock()',1000);
    document.write('&nbsp;&nbsp;<font id="calendarClock4"  style="color:#1623BF;font-family:宋体;font-size:9pt;line-height:120%"> </font>');
</SCRIPT>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics