YesYo.com MintState Forums
뒤로    YesYo.com MintState BBS > Tech > Javascript
검색
멤버이름    오토
비밀번호 
 

오늘 날짜와 시간 구하기

페이지 정보

작성자 MintState 댓글 0건 조회 12,886회 작성일 08-10-29 20:44

본문

오늘 날짜와 시간 구하기

---------- 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 태그에 넣어주세요. -------------
<body onLoad="clock()">



------------ 페이지 적당한곳에 들어갈 부분 --------
<form name="clock"> 
시간: 
<input type="text" name="time" size="8" value=""><br> 
날짜: 
<input type="text" name="date" size="8" value=""> 
</form> 

댓글목록

등록된 댓글이 없습니다.

Total 178건 9 페이지
Javascript 목록
번호 제목 글쓴이 조회 날짜
18 MintState 9968 10-31
17 MintState 11887 10-31
16 MintState 10447 10-30
15 MintState 12167 10-29
14 MintState 12096 10-29
13 MintState 13188 10-29
12 MintState 10968 10-29
11 MintState 10296 10-29
10 MintState 9877 10-29
9 MintState 10798 10-29
8 MintState 11825 10-29
7 MintState 10716 10-29
6 MintState 12933 10-29
열람중 MintState 12887 10-29
4 MintState 12175 10-29
3 MintState 10662 10-29
2 MintState 10722 10-29
1 MintState 12702 10-29
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2024, YesYo.com MintState. ™