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

1 Answer

0 votes
const dt = new Date();
  
console.log(dt.toLocaleString('en-US', { timeZone: 'America/New_York' })); 
  
  
  
/*
run:
  
5/19/2021, 4:01:35 AM
  
*/

 



answered May 19, 2021 by avibootz
edited Mar 4, 2022 by avibootz

Related questions

1 answer 140 views
1 answer 98 views
1 answer 164 views
1 answer 302 views
...