JavaScript Date toString() Method
- Previous Page
- Next Page
- Go to the Previous Level JavaScript Date Reference Manual
Definition and Usage
toString()
The method converts a Date object to a string.
Note:JavaScript automatically calls this method whenever it needs to display a Date object as a string.
Example
Convert a Date object to a string:
var d = new Date(); var n = d.toString();
Syntax
Date.toString()
Parameters
No parameters.
Technical Details
Return Value: | A string representing the date and time in string format. |
---|---|
JavaScript Version: | ECMAScript 1 |
Browser Support
Methods | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
toString() | Support | Support | Support | Support | Support |
- Previous Page
- Next Page
- Go to the Previous Level JavaScript Date Reference Manual