Alternative of Java's TimeZone class in Javascript

Viewed 10

Firstly, yes I understand that there are already multiple questions realted to this utc offset topic.

What I want to do is just get the utc offset from zone id: Europe/Helsinki.

In Java you just do:

TimeZone tz = TimeZone.getTimeZone("Europe/Helsinki")
tz.getOffset(new Date().getTime())

and it also manages DST too. Why isn't it possible in javascript.

Notes: No the script cannot be client side so I can't just do Date.getTimezoneOffset().

And I'm also willing to install packages if needed.

0 Answers
Related