TimeSerial函数返回指定小时,分钟和秒值的时间。
TimeSerial(hour,minute,second)
<!DOCTYPE html> <html> <body> <script language = "vbscript" type = "text/vbscript"> document.write(TimeSerial(20,1,2) & "<br />") document.write(TimeSerial(0,59,59) & "<br />") document.write(TimeSerial(7*2,60/3,15+3)& "<br />") </script> </body> </html>
将其另存为.html并在Internet Explorer中执行时,上述脚本将产生以下结果:
8:01:02 PM 12:59:59 AM 2:20:18 PM