이번주의 기간이 몇일부터 몇일까지인지 알려줍니다 > script

본문 바로가기

script

이번주의 기간이 몇일부터 몇일까지인지 알려줍니다

작성일 07-08-11 20:28

페이지 정보

작성자서방님 조회 375회 댓글 0건

본문

<html>
<head>
    <title>BLUEB</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function formatDate(date) {
       var mymonth = date.getMonth()+1;
       var myweekday = date.getDate();
       return (mymonth + "/" + myweekday);
}

function printWeek() {
       var now = new Date();
       var nowDayOfWeek = now.getDay();
       var nowDay = now.getDate();
       var nowMonth = now.getMonth();
       var nowYear = now.getYear();
       nowYear += (nowYear < 2000) ? 1900 : 0;
       var weekStartDate = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek);
       var weekEndDate = new Date(nowYear, nowMonth, nowDay + (6 - nowDayOfWeek));
       document.write("이번주는 :  " + formatDate(weekStartDate) + " - " + formatDate(weekEndDate));
}
-->
</script>
</HEAD>
<BODY>

<b>
<script>
printWeek();
</script>

</BODY>
</HTML>

댓글목록

등록된 댓글이 없습니다.

게시물 검색
Copyright © 서방님.kr All rights reserved.
PC 버전으로 보기