Date.prototype.toISOString()
The toISOString()
method returns a string in simplified extended ISO format (ISO 8601), which is always 24 or 27 characters long (YYYY-MM-DDTHH:mm:ss.sssZ
or ±YYYYYY-MM-DDTHH:mm:ss.sssZ
, respectively). The timezone is always zero UTC offset, as denoted by the suffix Z
.
Syntax
toISOString()
Return value
A string representing the given date in the ISO 8601 format according to universal time. It's the same format as the one required to be recognized by Date.parse()
.