VBScript:CDate功能

目录

该函数将有效的日期和时间表达式转换为类型date。

语法

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>

将其另存为.html并在Internet Explorer中执行时,上述脚本将产生以下结果:

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

作者:terry,如若转载,请注明出处:https://www.web176.com/vbscript/1136.html

(0)
打赏 支付宝 支付宝 微信 微信
terryterry
上一篇 2020年12月7日 下午3:33
下一篇 2020年12月7日 下午3:37

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注