JavaScript toISOString() Method
Example
Returns the string format of a Date object using the ISO standard:
var d=new Date();
var n=d.toISOString();
n Output result:
Try it »
Definition and Usage
The toISOString() method converts a Date object to a string using the ISO standard.
This standard is called ISO-8601, with the format: YYYY-MM-DDTHH:mm:ss.sssZ
Browser support





All major browsers support the toISOString() method
Note: Internet Explorer 8 and earlier versions of IE do not support the toISOString() method.
Syntax
Date
.toISOString()
Return Value
| Type | Description |
|---|---|
| String | Date and time in ISO standard format |
Technical Details
| JavaScript version: | 1.8 |
|---|
JavaScript Date object