사이트 내 전체검색
날짜와 시간 표시소스 2
로빈아빠
https://cmd.kr/javascript/109 URL이 복사되었습니다.

본문

<html>
<head>
<script Language="JavaScript">
var timeStr, dateStr;
function clock() {
now= new Date();
hours= now.getHours();
minutes= now.getMinutes();
seconds= now.getSeconds();
timeStr= "" + hours;
timeStr+= ((minutes < 10) ? ":0" : ":") + minutes;
timeStr+= ((seconds < 10) ? ":0" : ":") + seconds;
document.clock.time.value = timeStr;
date= now.getDate();
month= now.getMonth()+1;
year= now.getYear();
dateStr= "" + month;
dateStr+= ((date < 10) ? "/0" : "/") + date;
dateStr+= "/" + year;
document.clock.date.value = dateStr;
Timer= setTimeout("clock()",1000);
}
</script>
 
</head>

<body onLoad="clock();">

<form name="clock">
시간:
<input type="text" name="time" size="8" value="" style="border-style:none;"><br>
날짜:
<input type="text" name="date" size="8" value="" style="border-style:none;">
</form>
 
</body>
</HTML>

출처 : http://qdata.co.kr/bo/bbs/board.php?bo_table=jt&wr_id=53

댓글목록

등록된 댓글이 없습니다.

831 (16/17P)

Search

Copyright © Cmd 명령어 3.17.27.53