ホーム > Date > toTimeString

toTimeString

時刻を文字列に変換して返します.

シンタックス

dateObject.toTimeString()

解説

toTimeStringメソッドは時刻を文字列に変換して返します. 文字列の具体的な内容は実装に依存します.

サンプルコード

以下にtoTimeStringメソッドを使用したサンプルコードを示します.

<html>
  <head>
    <title>toTimeStringメソッドのサンプルコード</title>
  </head>
  <body>
    <script type="text/javascript" language="javascript">
      /* 本日日付を取得する */
      var now = new Date();
      document.write(now.toTimeString() + "<br />");
    </script>
  </body>
</html>

実行例

サンプルコードの実行結果は以下のようになります.

00:47:18 GMT+0900 (JST)

関連項目

スポンサード リンク

inserted by FC2 system