mixpanel-node-export
mixpanel-node-export copied to clipboard
Fix expire calculations
Previous way of calculating the expire parameter was incorrect. No need for the MixpanelAPI.prototype._get_utc() method, we can get a UTC timestamp natively via Date.prototype.getTime(). Additionally the _get_utc() was incorrectly implemented in that it was assuming getTime() returns local time and adding the getTimezoneOffset() value instead of subtracting. getTime() returns UTC and getTimezoneOffset() returns the difference in minutes, so positive timezone offsets return negative values and vice versa.