JavaScript toISOString() method

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 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>

Output:

1994-11-16T15:40:10.000Z
Please Share