X
I was making a project where I had to get the date in my timezone. The problem was my timezone couldn't change, even if the server was in a different zone. At first, I thought this was going to be fast, but it took me a lot longer than I wanted to find the info.
The Date class tells you the current time in milliseconds. If you attach the toLocaleString() method to it, it will give you the time in your current timezone.
toLocaleString() takes two parameters. The first is a string that displays the language you want the time in. Mine is 'en-US'. The second is an options object thats let's you choose how the time is shown(hours, minutes, seconds, timezone). I'm going to be using the default options for the hours, minutes and seconds. This timezone '{timeZone: "America/New_York"}' is the one I'm in.
Language Strings
Timezone Options