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 179 views
1 answer 226 views
2 answers 260 views
1 answer 290 views
1 answer 181 views
...