Here you can find the source of stdTimezoneOffset()
Date.prototype.stdTimezoneOffset = function() { var jan = new Date(this.getFullYear(), 0, 1); var jul = new Date(this.getFullYear(), 6, 1); return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset()); } Date.prototype.dst = function() { return this.getTimezoneOffset() < this.stdTimezoneOffset(); } function get_time_zone_offset() { var current_date = new Date(); return -current_date.getTimezoneOffset() / 60; }
Date.prototype.stdTimezoneOffset = function() { var jan = new Date(this.getFullYear(), 0, 1); var jul = new Date(this.getFullYear(), 6, 1); return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
Date.prototype.stdTimezoneOffset = function() { const jan = new Date(this.getFullYear(), 0, 1); const jul = new Date(this.getFullYear(), 6, 1); return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset()); };
Date.prototype.stdTimezoneOffset = function() { var jan = new Date(this.getFullYear(), 0, 1); var jul = new Date(this.getFullYear(), 6, 1); return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
var https = require('https'), env = require('dotenv').config(); var wakatimeAPI = process.env.WAKATIME_SECRET_KEY, encodedAPI = new Buffer(wakatimeAPI).toString('base64'); Date.prototype.stdTimezoneOffset = function() { var jan = new Date(this.getFullYear(), 0, 1); var jul = new Date(this.getFullYear(), 6, 1); return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset()); Date.prototype.dst = function() { return this.getTimezoneOffset() < this.stdTimezoneOffset(); var formatDate = function(timestamp){ var pad = function(digit){ digit = digit+""; if(digit.length < 2){ digit = '0'+digit; return digit }; var d = new Date(timestamp), year = parseInt(d.getFullYear(),10), month = pad(parseInt(d.getMonth(),10)+1), date = pad(parseInt(d.getDate(),10)); return year+'-'+month+'-'+date; };