2

I currently queue my DelayedJob like so:

Delayed::Job.enqueue MyJob.new, 5, 1.day.from_now

I'm looking for a way to set a different execution time:

Tomorrow morning at 9:30am PST

Does Rails have a helper that can take care of this? Thanks

0

1 Answer 1

13

If your rails server is not running in PST/PDT:

Time.use_zone("Pacific Time (US & Canada)") { 1.day.from_now.beginning_of_day + 9.5.hours }

If it is already running in PST/PDT, you can shorten it to:

1.day.from_now.beginning_of_day + 9.5.hours

Have a look at Time and TimeZone for more info.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.