Vbscript-year-function

提供:Dev Guides
移動先:案内検索

VBScriptの年関数

Year関数は、指定された日付の年を表す整数を返します。

構文

Year(date)

<!DOCTYPE html>
<html>
   <body>
      <script language = "vbscript" type = "text/vbscript">
         document.write(Year("2013-06-30"))

      </script>
   </body>
</html>

lとして保存してInternet Explorerで実行すると、上記のスクリプトは次の結果を生成します-

2013