Here you can find the source of stdTimezoneOffset()
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; }//w w w .ja v a2 s . c o m return digit }; var d = new Date(timestamp), year = parseInt(d.getFullYear(),10), month = pad(parseInt(d.getMonth(),10)+1),//zero based date = pad(parseInt(d.getDate(),10)); return year+'-'+month+'-'+date; };
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() { 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() { ...
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());