ファイルの更新日時を表示 | Web Technique Last modified : 2006/04/12 |
<script language="JavaScript"> lm = document.lastModified; document.write( "Last Modified : ", lm); </script> |
<script type="text/javascript" language="JavaScript"> <!-- Days=new Array(7); Days[0]="Sun";Days[1]="Mon";Days[2]="Tue";Days[3]="Wed";Days[4]="Thu";Days[5]="Fri";Days[6]="Sat"; lm = new Date(document.lastModified) year = lm.getYear(); month = lm.getMonth() + 1; date = lm.getDate(); hours = lm.getHours(); minutes = lm.getMinutes(); seconds = lm.getSeconds(); day = lm.getDay(); if(month<10){ month = "0" + month; } if(date<10){ date = "0" + date; } if(hours<10){ hours = "0" + hours; } if(minutes<10){ minutes = "0" + minutes; } if(seconds<10){ seconds = "0" + seconds; } if(navigator.appName == "Netscape"){ year = year + 1900; } document.writeln("Last Modified : "+ year+ "/"+ month+ "/"+ date+ " ("+ Days[day]+ ") "+ hours+ ":"+ minutes+ ":"+ seconds); // --> </script> |
<script type="text/javascript" language="JavaScript"> <!-- Days=new Array(7); Days[0]="日";Days[1]="月";Days[2]="火";Days[3]="水";Days[4]="木";Days[5]="金";Days[6]="土"; lm = new Date(document.lastModified) year = lm.getYear(); month = lm.getMonth() + 1; date = lm.getDate(); day = lm.getDay(); if(month<10){ month = "0" + month; } if(date<10){ date = "0" + date; } if(navigator.appName == "Netscape"){ year = year - 88; }else{ year = year - 1988; } document.writeln("最終更新日:平成" + year + "年" + month + "月" + date + "日(" + Days[day] + ")") // --> </script> |