Closed arnitkun closed 10 months ago
I ended up writing my own function to calculate time with offsets.
I ended up writing my own function to calculate time with offsets.
Hi! I'm facing the same issue. Will you please help me out how you've resolved it?
Thanks in advance :)
FYI this is addressed in #652
The issue still exists. Even though I set the offset as 330 (5 hr 30 min ahead of UTC) Input offset:
{ offset: 330 }
From modified time.js
if (typeof this.utcOffset !== 'undefined') {
... skipped ...
console.log({utcZone})
date = date.setZone(utcZone);
Output:
{ utcZone: 'UTC+5' }
This is just some debugging info from my console. The UTC string should've been 'UTC+5:30'
@AbhimanyuG thanks for the PR! I left a comment for you there 🙂
I have a job
someJob = new CronJob( '0 ${minutes} ${hours} * * ${targetday}', async () => { // job stuff }, null, null, null, null, null, '5:30', null, );
i also start the job.
I have also tried giving the constructor an object with key-value pairs; cronTime, onTick ...etc etc.
But the utcOffset does not work and I am unable to figure out why. If i use the same job in a scenario that does not require me to use offset, it works fine.
I am unable to find this in ANY code example except in a couple of git issues and even those do not work for me. have tried giving numbers and string as offset.
Can someone show me a practical example? i have spent hours trying to make it work. also getting no errors.