Forum: Ruby on Rails Another TimeZone Question - Multiple Legacy Databases

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
244af66f01565211d0bd67777ab6daf2?d=identicon&s=25 Mike P (Guest)
on 2009-04-10 00:32
(Received via mailing list)
We had to create a reporting software that connects to multiple
databases that are all in different time zones. Is there any way for
us to tell Rails which time zone each database is in and still be able
to have time zone support?

I need to be able to tell rails to pull the data from the various
database servers (easy enough) and display them in the user's timezone
(can't do it). Problem is, Rails either thinks the data is in UTC or
Local (rails app server) time zone.

I can't seem to find how to make it work. To tell Rails to get the
data from a time zone of Mountain Time (US & Canada) and do the
conversion from there instead of UTC.

Example -
Reporting Application Server:
Rails 2.3.2
Local Server TZ => Central Time (US)
Data Storage: Main Database Server, UTC TZ

Application #1:
Rails 2.3.2
Local Server TZ => Central Time (US)
Data Storage: Main DB Server, UTC TZ

Application #2:
PHP
Local Server TZ => Central Time (US)
Data Storage: Main DB Server, Central TZ

Application #3:
PHP
Local Server TZ => Eastern Time (US)
Data Storage: Secondary DB Server, Eastern TZ

Main Database Server:
Local Server TZ => Central Time (US)

Secondary DB:
Local Server TZ => Eastern Time (US)
This topic is locked and can not be replied to.