mixpanel-node-export icon indicating copy to clipboard operation
mixpanel-node-export copied to clipboard

Fix expire calculations

Open jaredmixpanel opened this issue 9 years ago • 0 comments

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.

jaredmixpanel avatar Apr 18 '16 11:04 jaredmixpanel