How to get a string for the time portion of a date object in JavaScript ES6

1 Answer

0 votes
const date = new Date(Date.now());

console.log(date.toTimeString());



/*
run:
   
21:35:38 GMT+0200 (GMT+02:00)

*/

 



answered Mar 23, 2020 by avibootz
...