How to calculate actual date time using timezone offset?

I am trying to calculate the actual datetime using the offset value present in my field.


I am currently calculating the sc-occurredOn-actual value using below piece of code.
"return doc['occurredOn'].value.getMillis() + 18000000 (5 hours difference)"

I want to remove the hard coded value of 18000000 as the time difference from next month will be 6 hours instead of 5. How can I achieve this automatically using the offset value ?

Can anyone please suggest me on this ?

times are already saved in ES as UTC time and they are converted to the user's set timezone. You can change your default timezone from "Browser" to "UTC" in the Advanced settings menu.