toTimeString()
displays the date's
hours, minutes, seconds, and time zone.
toTimeString() |
Yes | Yes | Yes | Yes | Yes |
dateObject.toTimeString();
None.
A string representing the time as a string
var aDate = new Date(Date.UTC(2021, 5, 4, 12, 21, 55));
console.log(aDate.toTimeString());
The code above generates the following result.