스크립트 날짜 형태 모음
페이지 정보
작성자 서방님 댓글 0건 조회 185회 작성일 07-06-22 16:52본문
<SCRIPT Language="Javascript">
<!-- 감춤
now=new Date();
document.write('<TR><TD>now</TD><TD>= ',now,'</TD></TR>');
document.write('<TR><TD>now.getDate()</TD><TD>= ',now.getDate(),'</TD></TR>');
document.write('<TR><TD>now.getHours()</TD><TD>= ',now.getHours(),'</TD></TR>');
document.write('<TR><TD>now.toGMTString()</TD><TD>= ',now.toGMTString(),'</TD></TR>');
document.write('<TR><TD>now.toLocaleString()</TD><TD>= ',now.toLocaleString(),'</TD></TR>');
document.write('<TR><TD>now.getDate()</TD><TD>= ',now.getDate(),'</TD></TR>');
document.write('<TR><TD>now.getDay()</TD><TD>= ',now.getDay(),'</TD></TR>');
document.write('<TR><TD>now.getHours()</TD><TD>= ',now.getHours(),'</TD></TR>');
document.write('<TR><TD>now.getMinutes()</TD><TD>= ',now.getMinutes(),'</TD></TR>');
document.write('<TR><TD>now.getMonth()</TD><TD>= ',now.getMonth(),'</TD></TR>');
document.write('<TR><TD>now.getSeconds()</TD><TD>= ',now.getSeconds(),'</TD></TR>');
document.write('<TR><TD>now.getTime()</TD><TD>= ',now.getTime(),'</TD></TR>');
document.write('<TR><TD>now.getTimezoneOffset()</TD><TD>= ',now.getTimezoneOffset(),'</TD></TR>');
document.write('<TR><TD>now.getYear()</TD><TD>= ',now.getYear(),'</TD></TR>');
document.write('<TR><TD><B>현재 시각</B> ');
document.write('(window status에도 나타남)</TD>');
timeValue=now.getYear()+'/'+(now.getMonth()+1)+'/'+now.getDate()+' ';
hours=now.getHours();
ampm=((hours >12) ? 'pm' : 'am');
hours=((hours >12) ? hours -12 : hours);
timeValue +=((hours < 10) ? ':0' : ':')+hours;
minutes=now.getMinutes();
timeValue +=((minutes < 10) ? ':0' : ':')+minutes;
seconds=now.getSeconds();
timeValue +=((seconds < 10) ? ':0' : ':')+seconds;
document.write('<TD>= <FONT color=0000ff><B>',timeValue+'</B></FONT><FONT color=ff0000> '+ampm.sup
(),'</FONT></TD></TR>');
window.status=timeValue+' '+ampm;
document.write('<TR><TD>페이지 최종 수정 document.lastModified</TD>');
document.write('<TD>= <FONT color=409040><B>',document.lastModified,'</B></FONT></TD></TR>');
// 감춤 끝 -->
</SCRIPT>
=============================================================
now = Thu Jun 15 13:08:16 UTC+0900 2006
now.getDate() = 15
now.getHours() = 13
now.toGMTString() = Thu, 15 Jun 2006 04:08:16 UTC
now.toLocaleString() = 2006년 6월 15일 목요일 오후 1:08:16
now.getDate() = 15
now.getDay() = 4
now.getHours() = 13
now.getMinutes() = 8
now.getMonth() = 5
now.getSeconds() = 16
now.getTime() = 1150344496125
now.getTimezoneOffset() = -540
now.getYear() = 2006
현재 시각 (window status에도 나타남) = 2006/6/15 :01:08:16 pm
페이지 최종 수정 document.lastModified = 06/15/2006 13:08:16
출처 : http://taeyo.net/threadboard/Content.asp?table=Board_Knowhow&seqs=1135
댓글목록
등록된 댓글이 없습니다.