Standard built-ins
Date.prototype.toISOString()
Return UTC date-time string in the specified ISO-like format. Invalid time values throw RangeError. Extended years use signed six digits.
Formal Syntax & Structure
javascript syntaxjavascript
date.toISOString()Return Value
String
UTC date-time string.
Working Example
Example Snippetjavascript
console.log(new Date(1234).toISOString());