LaYatiX

Add timezone to toJSON date parse

Jan 14th, 2021
440
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Date.prototype.toJSON = function() {
  2.   return new Date(this.setMinutes(this.getMinutes() - this.getTimezoneOffset())).toISOString();
  3. };
RAW Paste Data