JavaScript日付toISOString
toLocaleTimeString

toISOString日付

ISO 8601 形式の文字列を返します。

構文

date.toISOString()

使用例

下記の値を入力するとサンプルに即時反映されます。

const
new
console
toISOString
const date = new Date(2024, 5, 15, 12, 30, 0);
console.log(date.toISOString());
// "2024-06-15T03:30:00.000Z"