First I'll say that I've tried the solution in
Is it related to how react-js is working or am I writing the javascript code wrong?
CodePudding user response:
you can do it like this:
//your date
let temp = new Date();
let HMS = `${temp.getHours()}:${temp.getMinutes()}:${temp.getSeconds()}`
and now you have your hours:minutes:seconds