Date.prototype.getMilliseconds()

getMilliseconds() メソッドは、地方時に基づき、指定された日時の「ミリ秒」を返します。

試してみましょう

構文

js
getMilliseconds()

返値

地方時に基づき、指定された日時の「ミリ秒」を表す 0 から 999 までの間の数値。

getMilliseconds() の使用

次の例は、現在時刻のミリ秒部を変数 milliseconds に代入します。

js
const today = new Date();
const milliseconds = today.getMilliseconds();

仕様書

Specification
ECMAScript Language Specification
# sec-date.prototype.getmilliseconds

ブラウザーの互換性

BCD tables only load in the browser

関連情報