當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


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>

當你將它保存為 .html 並在 Internet Explorer 中執行它時,那麽上麵的腳本將產生以下結果——

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

相關用法


注:本文由純淨天空篩選整理自 VBScript CDate Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。