peter peter - 6 months ago 67
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!

Date.prototype.getTimezoneOffset = function () {return -120;};