タヌキのお散歩
タヌキのお散歩

備忘録JAVAスクリプトの変更点

現在人来訪中
トップ 一覧 検索 ヘルプ RSS ログイン 印刷
  • 追加された行はこのように表示されます。
  • 削除された行はこのように表示されます。
!!!備忘録JAVAスクリプト
!!本日の日を表示
{{code HTML,0,0
<script type="text/javascript">
<!--
 mydate=new Date();
 Ye=mydate.getFullYear()+"/";
 Mo=mydate.getMonth()+1+"/"; //getMonthの結果は1〜12月を0〜11で返してきます。
 Da=mydate.getDate();
 document.write("今日は:"+Ye+Mo+Da+"");
//-->
</script>
}}
{{code HTML,0,0
(結果) 今日は:2008/5/25
}}

!!現在の日時
{{code HTML,0,0
<script type="text/javascript">
<!--
 // 更新日表示
 now = new Date();
 year = now.getYear(); if (year < 2000) year = year + 1900;
 month = now.getMonth()+1;
 day = now.getDate();
 wk = new Array("日","月","火","水","木","金","土");
 document.write(""+year+"年"+month+"月"+day+"日");
// -->
</script>
<script type="text/javascript">
<!--
 my_date = new Date();
 hos = my_date.getHours();
 mis = my_date.getMinutes();
 document.write(hos + "時" + mis + "分");
//-->
</script> 現在
}}
{{code HTML,0,0
(結果) 2008年5月25日8時25分 現在  
}}

!!レーベンシュタイン距離
レーベンシュタイン距離(レーベンシュタインきょり)あるいは編集距離(へんしゅうきょり)は、情報理論において、二つの文字列がどの程度異なっているかを示す数値である。具体的には、文字の挿入や削除、置換によって、一つの文字列を別の文字列に変形するのに必要な手順の最小回数として与えられる。