Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different timezones for multiple databases... #13796

Closed
V1c70r opened this issue Jan 22, 2014 · 5 comments
Closed

Different timezones for multiple databases... #13796

V1c70r opened this issue Jan 22, 2014 · 5 comments

Comments

@V1c70r
Copy link

V1c70r commented Jan 22, 2014

I have a rails app with two database connections. My own database contains datetime fields in UTC. An external database contains datetime fields in EET/EEST. How can I set different timezones for two database connections? I think this is impossible...

@rafaelfranca
Copy link
Member

Please use the mailing list or StackOverflow for questions/help, where a wider community will be able to help you. We reserve the issues tracker for issues only.

@V1c70r
Copy link
Author

V1c70r commented Jan 22, 2014

But you can't set different default timezone for multiple databases. I think this is an issue...

@rafaelfranca
Copy link
Member

I don't consider. I see this more as a feature request. And feature requests can't be made in the issue tracker too.

@halida
Copy link

halida commented Jan 23, 2015

Facing the same problem, @V1c70r Do you have made an workaround?

ActiveRecord use value.in_time_zone in attribute_methods/time_zone_conversion.rb to convert timezone, which cannot be configured.
If we add a parameter for ActiveRecord, we can set ActiveRecord timezone separately, but it is still global, and cannot config timezone by connection.

@V1c70r
Copy link
Author

V1c70r commented Jan 23, 2015

@halida I monkey patched ActiveRecord for a workaround. Sorry but I lost sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants