fluent-plugin-sql
fluent-plugin-sql copied to clipboard
ActiveRecord default timezone
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
Could you send a PR?
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 's patch solves my problem, Without it, Time fields were losing time zone information and mis-converted to GMT
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.