The toLocaleTimeString() method returns the time part of a Date object as a string, using locale conventions.
The toLocaleTimeString() method returns the time part of a Date object as a string, using locale conventions.
Date.toLocaleTimeString()
A String, representing the time as a string
Return the time portion of a Date object as a string, using locale conventions:
//display the time as a string. var d = new Date(); var n = d.toLocaleTimeString(); console.log(n);/*www. j a v a2 s . c o m*/