The toString() method converts a Date object to a string.
The toString() method converts a Date object to a string.
This method is called by JavaScript when converting a Date object to a string.
Date.toString()
None
A String, representing the date and time as a string
Convert a Date object to a string:
//display the date and time as a string. var d = new Date(); var n = d.toString(); console.log(n);/*from w ww .java 2s . c o m*/ console.log(d);