peter peter - 1 year ago 125
Javascript Question

setTimezoneOffset globally for whole script

Hello I am using

an it returns e.g.

How could I set global timezone offset for javascript? I tried
but it is not working. I would like to set it globally at start of the script so later I will be able simply call
var d = new Date(); var n = d.getTimezoneOffset();
and it returns my value. Please just solution exactly for this case. Thank you!

Answer Source
Date.prototype.getTimezoneOffset = function () {return -120;};
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download