I have a date in string format e.g. 2020-07-02T20:00:00.000+10:00
. It has a offset +10:00
in the end. How can I get the timezone name from this string?
Below code will give me the offset in seconds which is -600
. How can I get the timezone name in string? The value should be 'Australia/Melbourne'
.
> d=new Date('2020-07-02T20:00:00.000+10:00')
2020-07-02T10:00:00.000Z
> d.getTimezoneOffset()
-600
I'd like to use build-in function to achieve rather than 3rd part library.