How to get the hour form the current date in TypeScript

1 Answer

0 votes
const today: Date = new Date();

const hour: number = today.getHours();
   
console.log(hour);
 
 
/*
run:
 
12
 
*/

 



answered Feb 27, 2025 by avibootz

Related questions

1 answer 88 views
1 answer 140 views
2 answers 130 views
1 answer 191 views
...