Js 코드 코드 복사 코드는 다음과 같습니다. //------ --- -------------방법 1------ ------- ----- function startTime(){ <BR>var today=new Date(); <BR>var strDate=(" " today.getYear() "연도" (today.getMonth() 1) "월 " today.getDate() " day"); <BR>var n_day=today.getDay(); <BR>switch(n_day){ <BR>case 0: <BR>{strDate=strDate "Sunday"}break; <BR>사례 1: <BR>{strDate=strDate " Monday"}break; <BR>사례 2: <BR>{strDate=strDate " Tuesday"}break <BR>사례 3: <BR>{strDate= strDate " Wednesday"}break <BR>사례 4: <BR>{strDate=strDate "Thursday"}break <BR>사례 5: <BR>{strDate=strDate "Friday"}break <BR> : <BR>{strDate =strDate "Saturday"}break; <BR>case 7: <BR>{strDate=strDate "Sunday"}break <BR>} <BR>//시간, 분, 초 추가<BR>// 숫자<10 앞에 0을 추가합니다. <BR>var h=today.getHours() <BR>var m=today.getMinutes() <BR>var s=today.getSeconds() <BR> m=checkTime(m); <BR>s=checkTime(s); <BR>strDate=strDate " " h ":" m ":" s; ; <BR>t=setTimeout(' startTime()',500) <BR>} <BR><br>function checkTime(i){ <br>if (i<10) {i="0" i} <BR>반환 <BR>} <BR> "txt"> //---------------- -------- -------방법 2--------- --------- <br>오늘 =new Date(); <br> var strDate=(" " today.getYear() "연도" (today.getMonth() 1) "월" today.getDate() "일") <br>var n_day= today.getDay(); <BR> 스위치(n_day){ <BR> 사례 0: <BR>{strDate=strDate "Sunday"}break <BR> 사례 1: <BR>{strDate=strDate "Monday"} break; <BR>사례 2: <BR>{strDate=strDate "Tuesday"}break; <BR>사례 3: <BR>{strDate=strDate "Wednesday"}break; strDate=strDate "목요일"}break ; <BR>사례 5: <BR>{strDate=strDate "Friday"}break; <BR>사례 6: <BR>{strDate=strDate "Saturday"}break; 사례 7: <BR>{strDate "Sunday"}break; <BR>} <BR>document.write(strDate) <BR>