question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I think we should support a timezone option for creating recurrence rules. I don’t think this is necessary in date-based scheduling, as it accepts a date and you can easily make a JS Date with timezone input using moment-timezone + moment’s .toDate()… or use UTC / milisecs. However, the only way (as far as I know) to schedule recurrence rules by timezone right now that doesn’t depend on system time is comparing the intended time you want to schedule X (timezone-specific, use moment timezone or an ISO string to make the date etc) against the current time (in your system’s timezone) to figure out what “hour” and “day” should be used for the recurring rule.

As per implementation, using moment-timezone is probably our best bet, but I’m open to any other options. I’d think the API should look something like a recurrence rule accepting the option of timezone i.e. rule.timezone = 'America/Los_Angeles'

Thoughts, @santigimeno?

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:28 (15 by maintainers)

github_iconTop GitHub Comments

33reactions
Tethikcommented, Apr 1, 2019

I had to dig a bit through cron-parser and the source of this library, but this functionality does exist at least for cron-like jobs.

Example that works for me:

schedule.scheduleJob(
    { rule: "21    17    *    *    1-5", tz: "Europe/Berlin" }, 
   () => console.log("hallo")
)
19reactions
damianobarbaticommented, Dec 18, 2017

wow, got back here after 1 year for the same reason. still no support for timezone?

Read more comments on GitHub >

github_iconTop Results From Across the Web

timezone-support
Lightweight time zone support for your applications or other date libraries.. Latest version: 3.1.0, last published: 19 days ago.
Read more >
prantlf/timezone-support: Lightweight time zone ...
Minimal interface for time zone lookup and conversions. Parsing, formatting and manipulating dates is usually the task for a higher-level date library.
Read more >
List of Supported Timezones - Manual
Here you'll find the complete list of timezones supported by PHP, ... Note: The latest version of the timezone database can be installed...
Read more >
timezone-support examples
Timezone Support Examples. Learn how to use timezone-support by viewing and forking example apps that make use of timezone-support on CodeSandbox.
Read more >
Timezone Support - Events Manager for WordPress
Timezone Support. Home > Documentation. Events Manager is timezone aware as of version 5.8.2. You can create events in different timezones around the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found