Vbscript-timevalue-function

提供:Dev Guides
移動先:案内検索

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>

lとして保存してInternet Explorerで実行すると、上記のスクリプトは次の結果を生成します-

8:30:00 PM
5:15:00 AM
2:30:58 AM