VBScript 第二個函式



Second 函式返回一個 0 到 59 之間表示指定時間戳小時中的秒數的數字。

語法

Second(time) 

示例

<!DOCTYPE html>
<html>
   <body>
      <script language = "vbscript" type = "text/vbscript">
         document.write("Line 1: " & Second("3:13:25 PM") & "<br />")
         document.write("Line 2: " & Second("23:13:45") & "<br />")
         document.write("Line 3: " & Second("2:20 PM") & "<br />")
       
      </script>
   </body>
</html>

當您將其另存為 .html 檔案並在 Internet Explorer 中執行時,上述指令碼將生成以下結果 −

Line 1: 25
Line 2: 45
Line 3: 0
vbscript_date.htm
廣告
© . All rights reserved.