ES6 - toTimeString() Method



This method returns the time portion of a Date object in human readable form.

Syntax

Date.toTimeString () 

Return Value

Returns the time portion of a Date object in human readable form.

Example

var dateobject = new Date(1993, 6, 28, 14, 39, 7); 
console.log( dateobject.toTimeString());          

Output

14:39:07 GMT+0530 (India Standard Time)           
Advertisements