JavaScript Date toISOString() Method
- Previous Page toDateString()
- Next Page toJSON()
- Go to the Previous Level JavaScript Date Reference Manual
Definition and Usage
toISOString()
The method uses the ISO standard to convert the Date object to a string.
This standard is called ISO-8601, and the format is: YYYY-MM-DDTHH:mm:ss.sssZ
Example
Return the Date object as a string using the ISO standard:
var d = new Date(); var n = d.toISOString();
Syntax
Date.toISOString()
Parameters
No parameters.
Technical Details
Return Value: | A string representing a date and time in ISO standard format. |
---|---|
JavaScript Version: | ECMAScript 3 |
Browser Support
The numbers in the table indicate the first browser version that fully supports this method.
Method | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
toISOString() | Support | Support | Support | Support | Support |
- Previous Page toDateString()
- Next Page toJSON()
- Go to the Previous Level JavaScript Date Reference Manual