サイト内検索

...JavaScript...

JavaScript・時間(タイマーイベント)

現在の時刻(英語)

ソース

<script language="JavaScript">
<!--
myTbl = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
myD = new Date();
myYear = myD.getYear();
myYear4 = (myYear < 2000) ? myYear+1900 : myYear;
myMonth = myD.getMonth() + 1;
myDate = myD.getDate();
myDay = myD.getDay();
mySeconds = myD.getSeconds();
myMess1 = myYear4 + "/" + myMonth + "/" + myDate + " ";
myMess2 = myTbl[myDay] + "";
myMess = myMess1 + " " + myMess2 + " " ;
document.write( myMess );
// -->
</script>

[bodyの中]

<script src="js/sample.js" type="text/javascript">
</script>

ブラウザ上

現在の時刻

Copyright c 2007.10.01 luc All rights reserved.