getMillisecondsメソッド

メソッド getMilliseconds は、 日付オブジェクト に適用され、現在のミリ秒の値 (0 から 999 までの数値) を返します。

構文

javascript日付.getMilliseconds();

例

現在のミリ秒の値を取得して表示してみましょう:

javascriptlet date = new Date();
let res = date.getMilliseconds();

console.log(res);

関連項目