该函数将有效的日期和时间表达式转换为类型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