該函數將有效的日期和時間表達式轉換為日期類型。
用法
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 UCase用法及代碼示例
- VBScript InStrRev用法及代碼示例
- VBScript TimeValue用法及代碼示例
- VBScript UBound用法及代碼示例
- VBScript IsArray用法及代碼示例
- VBScript LBound用法及代碼示例
- VBScript Erase用法及代碼示例
- VBScript InStr用法及代碼示例
- VBScript Left用法及代碼示例
- VBScript DatePart用法及代碼示例
- VBScript FormatDateTime用法及代碼示例
- VBScript IsDate用法及代碼示例
- VBScript Hour用法及代碼示例
- VBScript Right用法及代碼示例
- VBScript Mid用法及代碼示例
- VBScript WeekDayName用法及代碼示例
- VBScript Replace用法及代碼示例
注:本文由純淨天空篩選整理自 VBScript CDate Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。