欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

VBScript CDate 函數(shù)

定義和用法

CDate 函數(shù)可把一個合法的日期和時間表達式轉換為 Date 類型,并返回結果。

提示:請使用 IsDate 函數(shù)來判斷 date 是否可被轉換為日期或時間。

注釋:IsDate 函數(shù)使用本地設置來檢測字符串是否可被轉換為日期。

語法

CDate(date)
參數(shù) 描述
date 必需的。任何有效的日期表達式。(比如 Date() 或者 Now())

實例

例子 1

d="April 22, 2001"
if IsDate(d) then
  document.write(CDate(d))
end if

輸出:

2/22/01

例子 2

d=#2/22/01#
if IsDate(d) then
  document.write(CDate(d))
end if

輸出:

2/22/01

例子 3

d="3:18:40 AM"
if IsDate(d) then
  document.write(CDate(d))
end if

輸出:

3:18:40 AM