슈

서버시간을 사용한 전자시계

<script> 
var now = new Date(<?php echo time(); ?>*1000);
Number.prototype.zf = function(){return (this > 9 ? '' : '0') + this;}; 
function startTime() { 
now.setSeconds(now.getSeconds() + 1);
        var h = now.getHours().zf(), m = now.getMinutes().zf(), s = now.getSeconds().zf();
        document.getElementById('time').innerHTML = h + ':' + m + ':' + s;
setTimeout('startTime()',1000);
}
</script> 
<body onload="startTime()"> 
<div id="time"></div>
|

댓글 2개

앗 감사합니다! 복받으세요 (__)
감사합니다. 밀리세컨드까지 일치하게 가져오는 방법도 있을까요?
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
16-03-02 조회 3,248
16-01-19 조회 2,531
15-12-23 조회 2,961
15-12-08 조회 3,680
14-10-30 조회 5,737
14-06-06 조회 5,560
12-08-30 조회 3,916
12-08-20 조회 3,832
12-07-15 조회 5,159
12-07-13 조회 3,631
12-07-06 조회 3,858
12-06-27 조회 3,368
12-06-23 조회 3,574
12-05-03 조회 5,183
12-04-20 조회 4,128
12-03-29 조회 4,637
12-03-22 조회 4,743
12-03-22 조회 3,512
12-03-21 조회 3,286
12-03-11 조회 3,717
12-03-06 조회 4,265
12-02-22 조회 4,533
12-02-17 조회 3,332
12-02-17 조회 6,180
12-02-14 조회 6,139
12-02-06 조회 4,265
12-01-18 조회 3,219
12-01-06 조회 3,445
11-12-30 조회 3,917
11-12-30 조회 7,062
11-12-21 조회 3,284
11-12-21 조회 4,247
11-12-16 조회 3,277
11-12-15 조회 3,323
11-12-15 조회 3,424
11-12-15 조회 4,224
11-12-09 조회 3,229
11-12-09 조회 3,309
11-12-07 조회 2,877
11-12-07 조회 3,963
11-12-05 조회 4,419
11-12-02 조회 3,863
11-12-01 조회 2,738
11-12-01 조회 2,781
11-12-01 조회 2,767