【もどる】

■ 現在の時刻を表示する。

【SAMPLE】

【SAMPLEを例に】用意するもの  特にナシ
ソースコード[1]
下のソースコードをHTMLのヘッド(<head>)〜(</head>)内に記述してください。


ナシ

 

ソースコード[2]
下のコードはボディ(<body>)〜(,</body>)内の、ご自分の配置したい部分に記述してください

<SCRIPT LANGUAGE="JavaScript">
<!---
var y0="日";
var y1="月";
var y2="火";
var y3="水";
var y4="木";
var y5="金";
var y6="土";

function getyobi(y){

if(y==0){document.write(y0.fontcolor("red"))}
if(y==1){document.write(y1)}
if(y==2){document.write(y2)}
if(y==3){document.write(y3)}
if(y==4){document.write(y4)}

if(y==5){document.write(y5)}
if(y==6){document.write(y6.fontcolor("pink"))}

}

now=new Date()
nen=now.getYear();
if (nen<2000){
nen = nen +1900;
}else{
nen = nen;
}

document.write(nen,"年");
document.write(now.getMonth()+1,"月");
document.write(now.getDate(),"日");
document.write("(");
getyobi(now.getDay());
document.write(")");
document.write(now.getHours(),"時");
document.write(now.getMinutes(),"分");
document.write(now.getSeconds(),"秒");
//--->

</SCRIPT>


Copyright © 2000 asarinet,co.all rights reserved