Created
November 22, 2017 16:37
-
-
Save OutsourcedGuru/9c548f9f2737393f4791f922a198edb2 to your computer and use it in GitHub Desktop.
JavaScript Array Prototype
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
Date.prototype.toLocalTime = function() { | |
// PDT -0700 = -7 * 60 = -420 minutes in the timezone offset from GMT to PDT | |
var nMillisecondsInMinute = 60000; | |
var nMillisecondsThis = this.getTime(); | |
// Compensate for the GMT-stored time on production | |
if (isProduction) | |
nMillisecondsThis -= (420 * nMillisecondsInMinute); | |
return new Date(nMillisecondsThis); | |
}; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment