-
-
Save filip1/7bcff67d8d8ad878378e5e41acd851f4 to your computer and use it in GitHub Desktop.
JavaScript Date.toLocalISOString() method
This file contains 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
Date.prototype.toLocalISOString = function() { | |
var off = this.getTimezoneOffset(); | |
return new Date(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes() - off, this.getSeconds(), this.getMilliseconds()).toISOString().slice(0,-1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment