ホーム > Date > toString

toString

日時の値を示す文字列を返します.

シンタックス

dateObject.toString()

サンプルコード

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

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

実行例

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

Mon Dec 14 2009 01:59:28 GMT+0900 (JST)

スポンサード リンク

inserted by FC2 system