Convert a Date object to a string:
The result of n will be:
The toString() method converts a Date object to a string.
Note: This method is automatically called by JavaScript whenever a Date object needs to be displayed as a string.
Method | |||||
---|---|---|---|---|---|
toString() | Yes | Yes | Yes | Yes | Yes |
None |
Return Value: | A String, representing the date and time as a string |
---|---|
JavaScript Version: | 1.0 |