<html>
<head>
<script language="JavaScript">
<!--
function init_clock()
{
var type, i, top, obj, clocks;
clocks = new Array();
for (i = 0, top = 0; i < init_clock.arguments.length; i += 2) {
obj = eval('document.'+init_clock.arguments[i]);
if (obj == null) continue;
if ((type = init_clock.arguments[i+1]) < 1 && 11 < type) continue;
clocks[top++] = obj;
clocks[top++] = type;
}
clocks.months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December');
clocks.days = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday',
'Thursday', 'Friday', 'Saturday');
clocks.k_days = new Array('일', '월', '화', '수', '목', '금', '토');
clocks.ampm_str = new Array('AM', 'PM');
clocks.k_ampm_str = new Array('오전', '오후');
if (top > 0) {
document.clocks = clocks;
clock();
}
}
function clock()
{
var i, type, clocks, next_call, str, hour, ampm, now, year2, year4;
clocks = document.clocks;
if (clocks == null) return;
next_call = false;
for (i = 0; i < clocks.length; i += 2) {
obj = clocks[i];
type = clocks[i+1];
now = new Date();
year2 = now.getYear();
year4 = year2;
if (year2 < 1000) year4 = 1900 + year2;
if (year2 >= 100) year2 = year4;
if (type == 1 || type == 2) {
obj.value = clocks.months[now.getMonth()] + ' ' + now.getDate() + ', ' + year4;
if (type == 2)
obj.value = clocks.days[now.getDay()] + ', ' + obj.value;
} else if (type == 3 || type == 4) {
obj.value = year2 + '/' + (now.getMonth()+1) + '/' + now.getDate();
} else if (type == 5 || type == 6) {
obj.value = now.getDate() + '/' + (now.getMonth()+1) + '/' + year2;
} else if (type == 8 || type == 9 || type == 10 || type == 11) {
obj.value = year4 + '년 ' + (now.getMonth()+1) + '월 ' + now.getDate() + '일';
if (type == 9)
obj.value += ' ' + clocks.k_days[now.getDay()] + '요일';
}
if (type == 4 || type == 6 || type == 7 || type == 10 || type == 11) {
hour = now.getHours();
ampm = 0;
if (hour >= 12) {
if (hour > 12) hour -= 12;
ampm = 1;
}
if (type == 10 || type == 11) {
str = clocks.k_ampm_str[ampm] +' '+ hour+'시 '+ now.getMinutes() +'분';
if (type == 11) str += ' ' + now.getSeconds() +'초';
} else {
str = hour +':'+ ((now.getMinutes() < 10) ? '0'+now.getMinutes():now.getMinutes()) +':'+ ((now.getSeconds() < 10) ? '0'+now.getSeconds():now.getSeconds()) +' '+ clocks.ampm_str[ampm];
}
if (type == 7) obj.value = str;
else obj.value += ' ' + str;
}
if (type == 4 || type == 6 || type == 7 || type == 10 || type == 11)
next_call = true;
}
if (next_call)
window.setTimeout("clock();", 1000);
}
// -->
</script>
</head>
<body OnLoad="init_clock('mclock.textclock1', 11);">
아래 init_clock('form1.textclock1', 11) 함수의 밑줄친 부분의 숫자를 바꾸면 다양한 효과를 줄 수 있습니다.
<!--
init_clock(mclock.textclock1', 11) 함수의 밑줄친 부분의 숫자를 바꾸면 다음과 같은 효과를 줄 수 있습니다.
1 : December 4, 2000
2 : Tuesday, December 4, 2000
3 : 2000/12/4
4 : 2000/12/4 1:49:46 PM
5 : 4/12/2000
6 : 4/12/2000 1:50:40 PM
7 : 1:50:58 PM
8 : 2000년 12월 4일
9 : 2000년 12월 4일 화요일
10 : 2000년 12월 4일 오후 1시 51분
11 : 2000년 12월 4일 오후 1시 52분 6초
-->
<form name="mclock">
<input type="text" name="textclock1" size="30" style="border-style:none;">
</form>
</body>
</html><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
<head>
<script language="JavaScript">
<!--
function init_clock()
{
var type, i, top, obj, clocks;
clocks = new Array();
for (i = 0, top = 0; i < init_clock.arguments.length; i += 2) {
obj = eval('document.'+init_clock.arguments[i]);
if (obj == null) continue;
if ((type = init_clock.arguments[i+1]) < 1 && 11 < type) continue;
clocks[top++] = obj;
clocks[top++] = type;
}
clocks.months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December');
clocks.days = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday',
'Thursday', 'Friday', 'Saturday');
clocks.k_days = new Array('일', '월', '화', '수', '목', '금', '토');
clocks.ampm_str = new Array('AM', 'PM');
clocks.k_ampm_str = new Array('오전', '오후');
if (top > 0) {
document.clocks = clocks;
clock();
}
}
function clock()
{
var i, type, clocks, next_call, str, hour, ampm, now, year2, year4;
clocks = document.clocks;
if (clocks == null) return;
next_call = false;
for (i = 0; i < clocks.length; i += 2) {
obj = clocks[i];
type = clocks[i+1];
now = new Date();
year2 = now.getYear();
year4 = year2;
if (year2 < 1000) year4 = 1900 + year2;
if (year2 >= 100) year2 = year4;
if (type == 1 || type == 2) {
obj.value = clocks.months[now.getMonth()] + ' ' + now.getDate() + ', ' + year4;
if (type == 2)
obj.value = clocks.days[now.getDay()] + ', ' + obj.value;
} else if (type == 3 || type == 4) {
obj.value = year2 + '/' + (now.getMonth()+1) + '/' + now.getDate();
} else if (type == 5 || type == 6) {
obj.value = now.getDate() + '/' + (now.getMonth()+1) + '/' + year2;
} else if (type == 8 || type == 9 || type == 10 || type == 11) {
obj.value = year4 + '년 ' + (now.getMonth()+1) + '월 ' + now.getDate() + '일';
if (type == 9)
obj.value += ' ' + clocks.k_days[now.getDay()] + '요일';
}
if (type == 4 || type == 6 || type == 7 || type == 10 || type == 11) {
hour = now.getHours();
ampm = 0;
if (hour >= 12) {
if (hour > 12) hour -= 12;
ampm = 1;
}
if (type == 10 || type == 11) {
str = clocks.k_ampm_str[ampm] +' '+ hour+'시 '+ now.getMinutes() +'분';
if (type == 11) str += ' ' + now.getSeconds() +'초';
} else {
str = hour +':'+ ((now.getMinutes() < 10) ? '0'+now.getMinutes():now.getMinutes()) +':'+ ((now.getSeconds() < 10) ? '0'+now.getSeconds():now.getSeconds()) +' '+ clocks.ampm_str[ampm];
}
if (type == 7) obj.value = str;
else obj.value += ' ' + str;
}
if (type == 4 || type == 6 || type == 7 || type == 10 || type == 11)
next_call = true;
}
if (next_call)
window.setTimeout("clock();", 1000);
}
// -->
</script>
</head>
<body OnLoad="init_clock('mclock.textclock1', 11);">
아래 init_clock('form1.textclock1', 11) 함수의 밑줄친 부분의 숫자를 바꾸면 다양한 효과를 줄 수 있습니다.
<!--
init_clock(mclock.textclock1', 11) 함수의 밑줄친 부분의 숫자를 바꾸면 다음과 같은 효과를 줄 수 있습니다.
1 : December 4, 2000
2 : Tuesday, December 4, 2000
3 : 2000/12/4
4 : 2000/12/4 1:49:46 PM
5 : 4/12/2000
6 : 4/12/2000 1:50:40 PM
7 : 1:50:58 PM
8 : 2000년 12월 4일
9 : 2000년 12월 4일 화요일
10 : 2000년 12월 4일 오후 1시 51분
11 : 2000년 12월 4일 오후 1시 52분 6초
-->
<form name="mclock">
<input type="text" name="textclock1" size="30" style="border-style:none;">
</form>
</body>
</html><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
댓글 3개
Photofly
19년 전
좋네요...감사합니다...^^
19년 전
감사~~
18년 전
감사합니다. 잘 쓰겠습니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 4530 |
라이언31
|
13년 전 | 641 | |
| 4529 | 13년 전 | 798 | ||
| 4528 |
꼬꼬아부지
|
13년 전 | 1005 | |
| 4527 | 13년 전 | 613 | ||
| 4526 | 13년 전 | 696 | ||
| 4525 |
|
13년 전 | 1018 | |
| 4524 | 13년 전 | 994 | ||
| 4523 | 13년 전 | 2292 | ||
| 4522 | 13년 전 | 614 | ||
| 4521 | 13년 전 | 1258 | ||
| 4520 | 13년 전 | 1551 | ||
| 4519 |
복이219
|
13년 전 | 1204 | |
| 4518 | 13년 전 | 494 | ||
| 4517 | 13년 전 | 1295 | ||
| 4516 |
아이피마스터
|
13년 전 | 552 | |
| 4515 | 13년 전 | 646 | ||
| 4514 | 13년 전 | 646 | ||
| 4513 | 13년 전 | 1072 | ||
| 4512 |
ananom
|
13년 전 | 4363 | |
| 4511 |
ananom
|
13년 전 | 1479 | |
| 4510 | 13년 전 | 1219 | ||
| 4509 | 13년 전 | 684 | ||
| 4508 | 13년 전 | 847 | ||
| 4507 | 13년 전 | 937 | ||
| 4506 | 13년 전 | 703 | ||
| 4505 | 13년 전 | 631 | ||
| 4504 | 13년 전 | 475 | ||
| 4503 | 13년 전 | 523 | ||
| 4502 |
|
13년 전 | 1807 | |
| 4501 | 13년 전 | 1636 | ||
| 4500 |
|
13년 전 | 510 | |
| 4499 | 13년 전 | 1892 | ||
| 4498 | 13년 전 | 1152 | ||
| 4497 |
미션임파썩을
|
13년 전 | 890 | |
| 4496 | 13년 전 | 942 | ||
| 4495 |
공포의니이킥
|
13년 전 | 1111 | |
| 4494 | 13년 전 | 1978 | ||
| 4493 | 13년 전 | 1063 | ||
| 4492 | 13년 전 | 489 | ||
| 4491 |
두근두근따봉
|
13년 전 | 924 | |
| 4490 | 13년 전 | 1367 | ||
| 4489 |
jaein8060
|
13년 전 | 616 | |
| 4488 | 13년 전 | 1041 | ||
| 4487 |
ReeJang
|
13년 전 | 1821 | |
| 4486 | 13년 전 | 988 | ||
| 4485 | 13년 전 | 808 | ||
| 4484 | 13년 전 | 853 | ||
| 4483 | 13년 전 | 523 | ||
| 4482 | 13년 전 | 1181 | ||
| 4481 | 13년 전 | 1050 | ||
| 4480 |
|
13년 전 | 523 | |
| 4479 | 13년 전 | 912 | ||
| 4478 | 13년 전 | 3964 | ||
| 4477 | 13년 전 | 988 | ||
| 4476 |
wangko
|
13년 전 | 2708 | |
| 4475 | 13년 전 | 928 | ||
| 4474 | 13년 전 | 957 | ||
| 4473 | 13년 전 | 758 | ||
| 4472 |
|
13년 전 | 554 | |
| 4471 | 13년 전 | 1563 | ||
| 4470 | 13년 전 | 573 | ||
| 4469 | 13년 전 | 524 | ||
| 4468 | 13년 전 | 863 | ||
| 4467 | 13년 전 | 658 | ||
| 4466 | 13년 전 | 922 | ||
| 4465 | 13년 전 | 670 | ||
| 4464 | 13년 전 | 1721 | ||
| 4463 |
chongho
|
13년 전 | 2181 | |
| 4462 |
chongho
|
13년 전 | 1025 | |
| 4461 |
chongho
|
13년 전 | 1022 | |
| 4460 | 13년 전 | 755 | ||
| 4459 | 13년 전 | 2780 | ||
| 4458 | 13년 전 | 789 | ||
| 4457 | 13년 전 | 502 | ||
| 4456 | 13년 전 | 1334 | ||
| 4455 | 13년 전 | 1737 | ||
| 4454 | 13년 전 | 721 | ||
| 4453 | 13년 전 | 1254 | ||
| 4452 |
aequum
|
13년 전 | 1270 | |
| 4451 | 13년 전 | 1333 | ||
| 4450 |
도토리과자
|
13년 전 | 1433 | |
| 4449 | 13년 전 | 1092 | ||
| 4448 | 13년 전 | 8621 | ||
| 4447 | 13년 전 | 1206 | ||
| 4446 | 13년 전 | 1488 | ||
| 4445 | 13년 전 | 639 | ||
| 4444 |
|
13년 전 | 614 | |
| 4443 | 13년 전 | 693 | ||
| 4442 |
Msoft
|
13년 전 | 1055 | |
| 4441 |
|
13년 전 | 2105 | |
| 4440 | 13년 전 | 615 | ||
| 4439 | 13년 전 | 1654 | ||
| 4438 |
aequum
|
13년 전 | 1842 | |
| 4437 | 13년 전 | 988 | ||
| 4436 | 13년 전 | 923 | ||
| 4435 |
디귿소프트
|
13년 전 | 518 | |
| 4434 | 13년 전 | 1071 | ||
| 4433 | 13년 전 | 994 | ||
| 4432 | 13년 전 | 854 | ||
| 4431 | 13년 전 | 752 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기