JavaScript toISOString()

The JavaScript date toISOString() method is used to get the date in the form ISO format string.

Syntax:

dateObj.toISOString();

Return:
ISO format string representation of the date portion of a Date object.

Example:

<!DOCTYPE html>
<html>
<body>
<script>
var bday=new Date("November 16, 1994 21:10:10");
document.writeln(bday.toISOString());
</script>
</body>
</html>