pulse icon indicating copy to clipboard operation
pulse copied to clipboard

What timezone pulsecron support ?

Open SwastikKasera opened this issue 11 months ago • 3 comments

I am struggling with timezone. Can I set any timezones in job or only UTC?

SwastikKasera avatar Jan 06 '25 19:01 SwastikKasera

@SwastikKasera For timezone-related information, please refer to the page at https://docs-pulse.pulsecron.com/docs/creating-jobs/every

code-xhyun avatar Jan 07 '25 01:01 code-xhyun

Thanks for the response but my doubt is, this is the format for date time for a job ??

pulsecron.schedule("yyyy-MM-ddTHH:mm:ss+00:00", "job-name")

SwastikKasera avatar Jan 07 '25 08:01 SwastikKasera

Thanks for the response but my doubt is, this is the format for date time for a job ??

pulsecron.schedule("yyyy-MM-ddTHH:mm:ss+00:00", "job-name")

Hi. You can use the timezone option when scheduling.

Random Example

            const options = {
                timezone: jobToSend.timezone || 'UTC', // (use the timezones that moment.js tz has also for example)
                startDate: jobToSend.scheduledTime || null
            };

let job = await this.pulseInstance.create('jobName', basicJobData);

job = await job.repeatEvery('cronExpression', options);

Hope this helps.

b0dea avatar Feb 27 '25 12:02 b0dea