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

ActiveRecord default timezone #43

Open
valeba opened this issue Dec 22, 2016 · 4 comments
Open

ActiveRecord default timezone #43

valeba opened this issue Dec 22, 2016 · 4 comments

Comments

@valeba
Copy link

valeba commented Dec 22, 2016

Hi,

In reading from DB the time is always set to UTC, disregarding the DB setting.

To solve the issue, I tried to this line in the plugin:
ActiveRecord::Base.default_timezone = :local

It worked.

Regards

@repeatedly
Copy link
Member

Could you send a PR?

@stanleyxc
Copy link

Hi,
I recently ran into this issue using the out_sql portion of the plugin. I ended up hacked the code to support an extra parameter to override the default timezone. Are you still interested in a PR?

Sjolus added a commit to Sjolus/fluent-plugin-sql that referenced this issue Jun 29, 2021
Sjolus added a commit to Sjolus/fluent-plugin-sql that referenced this issue Jul 1, 2021
Fixes issue fluent#43

Signed-off-by: Johan Sjölin <sjolus@sjolus.org>
@gpavinteractiv
Copy link

@Sjolus 's patch solves my problem,
Without it, Time fields were losing time zone information and mis-converted to GMT

@EkremGuner
Copy link

Same issue for output plugin as well. Active record automatically fills the columns like "created_at", "updated_at". The time format seems to be UTC with no timezone info, hence UTC time is erroneously logged as local time.

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

No branches or pull requests

5 participants