const date = new Date(); // get the current date
console.log(date.toLocaleTimeString("en-us", {timeStyle: "short"})); // time
// Many options with Intl.DateTimeFormat
const formatter = new Intl.DateTimeFormat('en', {
hour12: true,
hour: 'numeric',
minute: '2-digit',
second: '2-digit'
});
formatter.format(new Date());
const dubbleZero = parseInt('00');
const time = new Date();
const formatedDate = `${dubbleZero + time.getHours()}:${dubbleZero + time.getMinutes()}:${dubbleZero + time.getSeconds()}`;
console.log(formatedDate);