New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependency tz-offset returning wrong value #217
Comments
FYI - If anyone is experiencing this issue and wants to apply a quick fix without rewriting too much code, I did the following to fix it. INSTALL:
MAKE THE FOLLOWING CHANGES IN 'scheduled-task.js' ... DECLARE: CHANGE THIS FUNCTION: |
I'm experiencing the same issue. All of my tasks are running 1 hour later than expected. |
There is a pending pull request to fix offsets: node-cron/tz-offset#11 |
New version released, now using moment-timezone. |
i.e. America/New_York is currently returning 300, but should be returning 240. I tried v0.0.1 (the version this package uses) as well as v0.0.2 (the version currently available). Both version returning 300 so all jobs are 1 hour off.
I suggest maybe moving this to moment instead to resolve this.
For example:
var tzOffset = require("tz-offset");
WRONG UTC OFFSET (used in the code today):
console.log(tzOffset.offsetOf("America/New_York"));
var moment = require("moment");
var tz = require("moment-timezone");
CORRECT OFFSET:
console.log(moment().tz("America/New_York").format('Z'));
CORRECT DATE AND TIME:
console.log(moment().tz("America/New_York").format());
The text was updated successfully, but these errors were encountered: