How to get the current date and time in new york with TypeScript

1 Answer

0 votes
const dt = new Date();
  
console.log(dt.toLocaleString('en-US', { timeZone: 'America/New_York' })); 
  
  
  
/*
run:
  
"3/4/2022, 5:02:12 AM" 
  
*/

 



answered Mar 4, 2022 by avibootz

Related questions

1 answer 146 views
1 answer 109 views
1 answer 173 views
1 answer 171 views
1 answer 161 views
...