Definition and Usage The toString() method converts a Date object to a string and returns the result. Syntax dateObject.toString() ...
Definition and Usage
The toString() method converts a Date object to a string and returns the result.Syntax
dateObject.toString() |
Example
In this example we will convert today's date to a string:<script type="text/javascript"> var d = new Date(); document.write (d.toString()); </script> |
The output of the code above will be:
Fri May 11 2012 14:38:06 GMT+0530 (India Standard Time) |