ホーム > Date > getMilliseconds

getMilliseconds

地方時に基づき,日付の「ミリ秒」を返します.

シンタックス

dateObject.getMilliseconds()

解説

getMillisecondsメソッドは地方時に基づき,0から999ミリ秒までの数字を返します.

サンプルコード

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

<html>
  <head>
    <title>getMillisecondsメソッドのサンプルコード</title>
  </head>
  <body>
    <script type="text/javascript" language="javascript">
      /* 本日日付 (2009/10/08 22:10:15) */
      var now = new Date();
      document.write(now.getMilliseconds() + "<br />");

      /* 1950/10/02 23:59:59*/
      var dt = new Date("October 2, 1950 23:59:59");
      document.write(dt.getMilliseconds() + "<br />");
    </script>
  </body>
</html>

実行例

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

489
0

関連項目

スポンサード リンク

inserted by FC2 system