現在の日付と時刻の Date オブジェクトを生成します。
構文
new Date()使用例
下記の値を入力するとサンプルに即時反映されます。
const→new→console→specific→Jan→toISOString→const now = new Date();
console.log(now); // Current date and time
const specific = new Date(2024, 0, 1); // Jan 1, 2024
console.log(specific.toISOString());