Description
The toString() method is used to convert a Date value to a string, and return the result.
This method has the form:
Date.toString()
Note: This method is called by JavaScript automatically whenever a Date object is used in a situation requiring a string.
Examples
The following example shows the basic use of this method.
<script>
var d = new Date();
document.write(d.toString());
</script>
This produces the following result:
Browser Support
Firefox | IE | Chrome | Opera | Safari |
---|---|---|---|---|