Vbscript-cdate-function

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

VBScript CDate関数

この関数は、有効な日付と時刻の式を日付型に変換します。

構文

cdate(date)

<!DOCTYPE html>
<html>
   <body>
      <script language = "vbscript" type = "text/vbscript">
         a = cdate("Jan 01 2020")
         document.write("The Value of a : " & a)
         document.write("<br/>")
         b = cdate("31 Dec 2050")
         document.write("The Value of b : " & b)

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

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

The Value of a : 1/01/2012
The Value of b : 31/12/2050