날짜와 시간 표시소스
로빈아빠
본문
<script language="JavaScript">
<!--
var days = new Array();
days[0] = "일요일";
days[1] = "월요일";
days[2] = "화요일";
days[3] = "수요일";
days[4] = "목요일";
days[5] = "금요일";
days[6] = "토요일";
var months = new Array();
months[0] = "1월";
months[1] = "2월";
months[2] = "3월";
months[3] = "4월";
months[4] = "5월";
months[5] = "6월";
months[6] = "7월";
months[7] = "8월";
months[8] = "9월";
months[9] = "10월";
months[10] = "11월";
months[11] = "12월";
// -->
</script>
<strong><font color="#000000" size="2">오늘은 <script language="JavaScript"><!--
var now = new Date();
document.write(months[now.getMonth()] + now.getDate() +"일 " + days[now.getDay()]);
// --></script></strong></font></td>
</tr>
<tr>
<td width="100%"><strong>
</strong><div id="Clock" align="left" style="font-family:verdana; font-size:12; color:'red'"></div><script>
function tick() {
var hours, minutes, seconds, ap;
var intHours, intMinutes, intSeconds;
var today;
today = new Date();
intHours = today.getHours();
intMinutes= today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0) {
hours = "12:";
ap = "Midnight";
} else if (intHours<12) {
hours = intHours+":";
ap = "A.M.";
} else if (intHours ==12) {
hours = "12:";
ap = "Noon";
} else {
intHours = intHours - 12
hours = intHours + ":";
ap = "P.M.";
}
if (intMinutes <10) {
minutes = "0"+intMinutes+":";
} else {
minutes = intMinutes+":";
}
if (intSeconds <10) {
seconds = "0"+intSeconds+" ";
} else {
seconds = intSeconds+"";
}
timeString = hours+minutes+seconds+ap;
Clock.innerHTML = timeString;
window.setTimeout("tick();", 100);
}
window.onload = tick;
</script>
출처 : http://qdata.co.kr/bo/bbs/board.php?bo_table=jt&wr_id=52
<!--
var days = new Array();
days[0] = "일요일";
days[1] = "월요일";
days[2] = "화요일";
days[3] = "수요일";
days[4] = "목요일";
days[5] = "금요일";
days[6] = "토요일";
var months = new Array();
months[0] = "1월";
months[1] = "2월";
months[2] = "3월";
months[3] = "4월";
months[4] = "5월";
months[5] = "6월";
months[6] = "7월";
months[7] = "8월";
months[8] = "9월";
months[9] = "10월";
months[10] = "11월";
months[11] = "12월";
// -->
</script>
<strong><font color="#000000" size="2">오늘은 <script language="JavaScript"><!--
var now = new Date();
document.write(months[now.getMonth()] + now.getDate() +"일 " + days[now.getDay()]);
// --></script></strong></font></td>
</tr>
<tr>
<td width="100%"><strong>
</strong><div id="Clock" align="left" style="font-family:verdana; font-size:12; color:'red'"></div><script>
function tick() {
var hours, minutes, seconds, ap;
var intHours, intMinutes, intSeconds;
var today;
today = new Date();
intHours = today.getHours();
intMinutes= today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0) {
hours = "12:";
ap = "Midnight";
} else if (intHours<12) {
hours = intHours+":";
ap = "A.M.";
} else if (intHours ==12) {
hours = "12:";
ap = "Noon";
} else {
intHours = intHours - 12
hours = intHours + ":";
ap = "P.M.";
}
if (intMinutes <10) {
minutes = "0"+intMinutes+":";
} else {
minutes = intMinutes+":";
}
if (intSeconds <10) {
seconds = "0"+intSeconds+" ";
} else {
seconds = intSeconds+"";
}
timeString = hours+minutes+seconds+ap;
Clock.innerHTML = timeString;
window.setTimeout("tick();", 100);
}
window.onload = tick;
</script>
출처 : http://qdata.co.kr/bo/bbs/board.php?bo_table=jt&wr_id=52
관련링크
댓글목록
등록된 댓글이 없습니다.