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


VBScript TimeValue用法及代碼示例


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

相關用法


注:本文由純淨天空篩選整理自 VBScript TimeValue Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。