Answers for "get current formatted time in javascript"

1

get current formatted time in javascript

const date = new Date(); // get the current date
console.log(date.toLocaleTimeString("en-us", {timeStyle: "short"})); // time
Posted by: Guest on March-03-2022
0

js get formatted time

const dubbleZero = parseInt('00');
  const time = new Date();
  const formatedDate = `${dubbleZero + time.getHours()}:${dubbleZero + time.getMinutes()}:${dubbleZero + time.getSeconds()}`;
  console.log(formatedDate);
Posted by: Guest on December-13-2021

Code answers related to "get current formatted time in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language