Reputation: 4725
In JavaScript, I have unix timestamp, how do i convert it to data+time for any given timezone, regardless of the local timezone? I am especially interested in US/eastern
Upvotes: 1
Views: 38
Reputation: 12864
You can use the property .toLocaleString
and set the desired timeZone
const unixTimestamp = 1548979200000;
new Date(unixTimestamp).toLocaleString("en-US", {timeZone: "US/Eastern"})
Upvotes: 2