當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


VBScript Second用法及代碼示例


Second Function 返回一個介於 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 Second Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。