웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
2005/10/16 21:15 pm 형식으로 출력되는 시계
2005.10.18 13:23
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<title>2005/10/16 21:15
</title>
<meta name="generator" content="Namo WebEditor v5.0">
<SCRIPT LANGUAGE="JavaScript">
<!--
function clock() {
if (!document.layers && !document.all) return;
var digital = new Date();
var hours = digital.getHours();
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
var amOrPm = "AM";
if (hours == 0) hours = 12;
if (hours > 11) amOrPm = "PM";
if (hours > 12) hours = hours - 12;
if (minutes <= 9) minutes = "0" + minutes;
if (seconds <= 9) seconds = "0" + seconds;
dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;
if (document.layers) {
document.layers.pendule.document.write(dispTime);
document.layers.pendule.document.close();
}
else
if (document.all)
pendule.innerHTML = dispTime;
setTimeout("clock()", 1000);
}
// -->
</script>
</head><body bgcolor="white" text="black" link="blue" vlink="purple" alink="red" onLoad="clock();">
<table cellpadding="0" cellspacing="0" width="191">
<tr>
<td width="79">
<p><script>
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()+1
if (month<10)
month="0"+month
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
document.write(""+year+"/"+daym+"/"+month+"")
</script></p>
</td>
<td width="112">
<p></p>
<div id="pendule"> </div> </td>
</tr>
</table>
</body>
</html>
여기 줏어다가 짜보았답니다.
그렇다고 쓰레기는 아니죠....ㅎㅎ 그람 수고! ☞ ¤ - ® - ▦ 퍽!퍽!퍽!들어가있어!
<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<title>2005/10/16 21:15
</title>
<meta name="generator" content="Namo WebEditor v5.0">
<SCRIPT LANGUAGE="JavaScript">
<!--
function clock() {
if (!document.layers && !document.all) return;
var digital = new Date();
var hours = digital.getHours();
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
var amOrPm = "AM";
if (hours == 0) hours = 12;
if (hours > 11) amOrPm = "PM";
if (hours > 12) hours = hours - 12;
if (minutes <= 9) minutes = "0" + minutes;
if (seconds <= 9) seconds = "0" + seconds;
dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;
if (document.layers) {
document.layers.pendule.document.write(dispTime);
document.layers.pendule.document.close();
}
else
if (document.all)
pendule.innerHTML = dispTime;
setTimeout("clock()", 1000);
}
// -->
</script>
</head><body bgcolor="white" text="black" link="blue" vlink="purple" alink="red" onLoad="clock();">
<table cellpadding="0" cellspacing="0" width="191">
<tr>
<td width="79">
<p><script>
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()+1
if (month<10)
month="0"+month
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
document.write(""+year+"/"+daym+"/"+month+"")
</script></p>
</td>
<td width="112">
<p></p>
<div id="pendule"> </div> </td>
</tr>
</table>
</body>
</html>
여기 줏어다가 짜보았답니다.
그렇다고 쓰레기는 아니죠....ㅎㅎ 그람 수고! ☞ ¤ - ® - ▦ 퍽!퍽!퍽!들어가있어!
댓글 5
-
수니
2005.10.18 20:18
-
수니
2005.10.18 20:27
참..사실 원래 구현하고자 하는건..
현재시각 뒤에 이어서 역으로 계산하는 시간 까지 같이 할려고 한거였는데..
2005/10/16 21:15 pm // 우리 만난지 100일 되는 날입니다..<= 요렇게..ㅎㅎ
'우리 만난지 100일 되는 날입니다'하는 소스는 찾아서 적용해보니 되더라구요..
그런데 현재시각 나오는 소스를 못찾겠길래 도움을 요청한건데요..
가능하면 두 소스가 같이 나오게 할수있으면 더욱 좋겠네요..
으..뻔뻔..브끄...후다닥 =3 =3 =33 -
워니
2005.10.18 19:28
넷스와 익스가 아니면 먹히지 않는군요 ;;
전 브라우저용 소스를 만들어 보았습니다 :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<title>Clock</title>
<script type="text/javascript">
<!--
// <![CDATA[
var tobj = null;
function clock()
{
var dtime = new Date();
var year = dtime.getFullYear();
var month = dtime.getMonth() + 1;
var day = dtime.getDate();
var hour = dtime.getHours();
var minute = dtime.getMinutes();
var second = dtime.getSeconds();
var ptime = 'A.M.';
if(hour > 11) ptime = 'P.M.';
if(!hour) hour = 12;
if(hour > 12) hour -= 12;
if(month < 10) month = '0' + month;
if(day < 10) day = '0' + day;
if(minute < 10) minute = '0' + minute;
if(second < 10) second = '0' + second;
var outstring = year + '+ '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second + ' ' + ptime;
var obj = document.getElementById('spn_time');
if(tobj)
obj.removeChild(tobj);
tobj = document.createTextNode(outstring);
obj.appendChild(tobj);
}
window.onload = function(e) { setInterval('clock();', 200); }
// ]]>
//-->
</script>
</head>
<body>
<div>
<span id="spn_time"></span>
</div>
</body>
</html> -
워니
2005.10.19 21:36
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<title>Clock</title>
<script type="text/javascript">
<!--
// <![CDATA[
var tobj = null;
var start = new Date('2005 September 3'); // 이 부분에 날짜를 넣어주세요 (예제 형식으로).
start = parseInt(start.getTime() / 86400000);
function clock()
{
var dtime = new Date();
var year = dtime.getFullYear();
var month = dtime.getMonth() + 1;
var day = dtime.getDate();
var hour = dtime.getHours();
var minute = dtime.getMinutes();
var second = dtime.getSeconds();
var elapsed = parseInt(dtime.getTime() / 86400000) - start;
var ptime = 'A.M.';
if(hour > 11) ptime = 'P.M.';
if(!hour) hour = 12;
if(hour > 12) hour -= 12;
if(month < 10) month = '0' + month;
if(day < 10) day = '0' + day;
if(minute < 10) minute = '0' + minute;
if(second < 10) second = '0' + second;
var outstring = year + '+ '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second + ' ' + ptime + ' // 우리 만난지 ' + elapsed + '일 되는 날입니다';
var obj = document.getElementById('spn_time');
if(tobj)
obj.removeChild(tobj);
tobj = document.createTextNode(outstring);
obj.appendChild(tobj);
}
window.onload = function(e) { setInterval('clock();', 200); }
// ]]>
//-->
</script>
</head>
<body>
<div>
<span id="spn_time" style="font-family: Tahoma, Verdana, Sans-serif; font-size: 9pt;"></span>
</div>
</body>
</html>
그... 그런 거였나요... -;
뭐 이정도면 되실듯? -
수니
2005.10.20 20:57
^^*
오홋..너무너무 감사합니다.
추천 꾸악~꾸악~꾸악~ 여러번 눌러도 안될테니까 한번만 ^^*
제목 | 글쓴이 | 날짜 |
---|---|---|
[mics'php] 들어가기 전에 [1] | TheMics | 2003.04.11 |
PHP 혼자 공부하기 - 6 :: 연산자 [7] | 행복한고니 | 2003.04.11 |
PHP 혼자 공부하기 - 5 :: 변수 [4] | 행복한고니 | 2003.04.10 |
PHP 혼자 공부하기 - 4 :: 미리 정의된 변수 [13] | 행복한고니 | 2003.04.09 |
PHP 혼자 공부하기 - 3 :: 변수형 [8] | 행복한고니 | 2003.04.09 |
PHP 혼자 공부하기 - 2 :: PHP의 시작 [9] | 행복한고니 | 2003.04.09 |
PHP 혼자 공부하기 - 1 :: 준비물 [3] | 행복한고니 | 2003.04.09 |
개판 오분전 세션 - 7 [10] | 미친개 | 2003.04.08 |
개판 오분전 세션 - 6 | 미친개 | 2003.04.08 |
개판 오분전 세션 - 5 | 미친개 | 2003.04.08 |
개판 오분전 세션 - 4 | 미친개 | 2003.04.08 |
개판 오분전 세션 - 3 [4] | 미친개 | 2003.04.08 |
개판 오분전 세션 - 2 [4] | 미친개 | 2003.04.08 |
개판 오분전 세션 - 1 [7] | 미친개 | 2003.04.08 |
객체를 이용한 winamp 방송정보 알아내는 소스 [4] | 흑심품은연필 | 2003.04.07 |
글자 깨짐 없이 문자열 자르기(hex2bin 함수 이용) [13] | 미친개 | 2003.04.05 |
내 홈피도 채널을?! #1 [16] | (' _ ') napclub | 2003.03.31 |
이젠 주소검색 편하게쓰자~~~!! (새창띄우지 않습니다) [5] | _-=Knight=-_ | 2003.03.05 |
메일 인증시 기존 회원 전부 인증걸기;;; [4] | teslaMINT | 2003.03.04 |
게시판 통체 인클루드 하기 [12] | 깜보 | 2003.03.02 |
두분 모두 감사합니다..
한데.. 폰트 크기 조절이 안되더라구요..
폰트크기 조절을 할순없나여?