Javascript-date-totimestring

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

JavaScriptの日付-toTimeStringメソッド

説明

このメソッドは、Dateオブジェクトの時間部分を人間が読める形式で返します。

構文

その構文は次のとおりです-

Date.toTimeString ()

戻り値

Dateオブジェクトの時間部分を人間が読める形式で返します。

次の例を試してください。

<html>
   <head>
      <title>JavaScript toTimeString Method</title>
   </head>

   <body>
      <script type = "text/javascript">
         var dateobject = new Date(1993, 6, 28, 14, 39, 7);
         document.write( dateobject.toTimeString() );
      </script>
   </body>
</html>

出力

14:39:07 GMT+0530 (India Standard Time)