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 185 views
1 answer 232 views
2 answers 268 views
1 answer 298 views
1 answer 186 views
...