JavaScriptDatetoISOString
toLocaleTimeString

toISOStringDate

Returns a string in simplified extended ISO format.

Syntax

date.toISOString()

Example

Enter values below to update the example in real time.

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