Skip to content

Commit

Permalink
Add doc for trigger thread time zone, gh-341
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Jun 9, 2023
1 parent 22a94c9 commit ee2868a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,26 @@ require 'tzinfo/data'
require 'rufus-scheduler'
```

### Timezone in the schedule thread

Currently (3.9.x), rufus-scheduler strives to trigger at the right time. The trigger thread might not yield a `Time.now` in the scheduled timezone.

```ruby
ENV['TZ'] = 'Asia/Tokyo'

require 'rufus-scheduler'

s = Rufus::Scheduler.new

s.cron('*/5 * * * * * Europe/Rome') do
p Time.now # ==> the representation will indicate the time is UTC+0900...
end

s.join
```

In the wake of [gh-341](https://github.com/jmettraux/rufus-scheduler/issues/341).


## so Rails?

Expand Down

0 comments on commit ee2868a

Please sign in to comment.