# Timed events across time zones

**URL:** <https://www.ruby-forum.com/t/timed-events-across-time-zones/135223>\
**Category:** Rails\
**Created:** [April 19, 2008, 11:33am UTC](https://www.ruby-forum.com/t/timed-events-across-time-zones/135223 "2008-04-19T11:33:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![binkly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5e925/32.png) [@binkly](https://www.ruby-forum.com/u/binkly)\
**Post date:** [April 19, 2008, 11:33am UTC](https://www.ruby-forum.com/t/timed-events-across-time-zones/135223/1 "2008-04-19T11:33:45Z")

</div>

I have an application design question to ask.

Say you have a server running in the Pacific time zone, and your app  
allows users to schedule emails to be sent to them based on their local  
time zone. So for instance, an e-mail schedule to be sent at 6 PM  
Eastern time would have to run on the server at 3 PM it’s time, and if a  
user in central scheduled for the same time relative to them their task  
would also run at 3 PM pacific.

My approach to the problem was to have a task running every hour that  
checks for scheduled events in it’s time zone and then just iterates  
across the other time zones, collecting events and then e-mailing. This  
seems like a pretty straight forward way to do it, but I was wondering  
if anyone can recommend a more optimal approach.

Thanks,

Binh

---

<div class="post-metadata">

**Author:** ![binkly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5e925/32.png) [@binkly](https://www.ruby-forum.com/u/binkly)\
**Post date:** [April 19, 2008, 11:53am UTC](https://www.ruby-forum.com/t/timed-events-across-time-zones/135223/2 "2008-04-19T11:53:33Z")

</div>

On 19 Apr 2008, at 10:33, Binh Ly wrote:

> task  
> would also run at 3 PM pacific.
> 
> My approach to the problem was to have a task running every hour that  
> checks for scheduled events in it’s time zone and then just iterates  
> across the other time zones, collecting events and then e-mailing.  
> This  
> seems like a pretty straight forward way to do it, but I was wondering  
> if anyone can recommend a more optimal approach.

Have everything in the database be utc. Only your ui bothers with  
timezones, nothing else needs to know about them.

Fred
