I have a UTC date i.e Sat, 19 Jan 2019 05:40:07 GMT
. I want to extract time string from given date i.e 05:40:07
. all methods so far I've tried are to get a timestamp
. So, I've written my own below code to extract time
var date = new Date('Sat, 19 Jan 2019 05:40:07 GMT');
console.log(date.toISOString().split("T")[1].split(".")[0]);
i.e first converted the date into ISO format then split it
Is there any other way to get this without converting it to any other format because my method is correct if there is no direct process to acquire it?