TimeValue函数将给定的输入字符串转换为有效时间。
语法
TimeValue(StringTime)
例
<!DOCTYPE html> <html> <body> <script language = "vbscript" type = "text/vbscript"> document.write(TimeValue("20:30") & "<br />") document.write(TimeValue("5:15") & "<br />") document.write(TimeValue("2:30:58") & "<br />") </script> </body> </html>
将其另存为.html并在Internet Explorer中执行时,上述脚本将产生以下结果:
8:30:00 PM 5:15:00 AM 2:30:58 AM
作者:terry,如若转载,请注明出处:https://www.web176.com/vbscript/1180.html