How to get the current date and time in new york with Node.js

1 Answer

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

 



answered Mar 4, 2022 by avibootz

Related questions

1 answer 141 views
1 answer 99 views
1 answer 166 views
1 answer 140 views
1 answer 180 views
...