The toLocaleTimeString() function of date object return time part as string. Use it for example to get time part as string.
Syntax
This will produce following result