In general, this is not possible.
US/Eastern is the identifier for the time zone. (This is actually an alias of America/New_York , which is the real identifier.)
240 is the time zone offset. This is most often written as -04:00 (invert the sign, divide by 60).
The US eastern time zone includes both Eastern Standard Time, with an offset of -05:00 , and Eastern Daylight Time, which has an offset of -04:00 .
So itβs not at all so to say US/Eastern = 240. Read the time zone wiki , especially the "Time Zone! = Offset" section.
Now you have requested the current offset, which is possible. If you provide date + time, you can solve this problem.
In the local time zone of the computer running the javascript code, it is embedded with .getTimeZoneOffset() from any instance of the Date object.
But if you want it for a specific time zone, you will need to use one of the libraries I have listed .
Matt johnson
source share