서버시간을 사용한 전자시계
<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개
11년 전
앗 감사합니다! 복받으세요 (__)
11년 전
감사합니다. 밀리세컨드까지 일치하게 가져오는 방법도 있을까요?
게시글 목록
| 번호 | 제목 |
|---|---|
| 17730 | |
| 11739 | |
| 11738 |
MySQL
mysqlDB export 복원
|
| 20311 | |
| 11737 | |
| 11736 | |
| 11735 | |
| 11734 | |
| 11732 | |
| 11731 | |
| 11730 | |
| 11729 | |
| 11728 | |
| 20308 |
HTML
html5 멋진 사이트 1곳
2
|
| 20307 |
CSS
overflow 속성
|
| 11727 | |
| 11724 | |
| 11723 | |
| 20306 | |
| 20304 | |
| 11722 | |
| 11721 | |
| 11720 |
웹서버
wget에 대한 팁
|
| 11719 | |
| 11718 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기