The toLocaleString() method converts a Date object to a string, using locale settings.
The toLocaleString() method converts a Date object to a string, using locale settings.
Date.toLocaleString()
A String, representing the date and time as a string
Convert a Date object to a string, using locale conventions:
//display the date and time as a string. var d = new Date(); var n = d.toLocaleString(); console.log(n);//from w ww . ja v a 2s. c om