The toLocaleDateString() method converts the date part of a Date object into a readable string, using locale settings.
The toLocaleDateString() method converts the date part of a Date object into a readable string, using locale settings.
Date.toLocaleDateString()
A String, representing the date as a string
Return the Date object as a string, using locale conventions:
//display the date as a string. var d = new Date(); var n = d.toLocaleDateString(); console.log(n);//from w ww . ja v a 2 s .c o m