0

I set in application.rb

config.time_zone = 'Pacific/Auckland'
config.active_record.default_timezone = :local # Or :utc

But records still are not saving in this timezone

Haseeb Ahmad
  • 7,914
  • 12
  • 55
  • 133

1 Answers1

0

Records are always stored in database with UTC time. Your config timezone is just used to display time, not saving.

Thanh
  • 8,219
  • 5
  • 33
  • 56
  • Could you tell us how we can go around it? – Kick Buttowski Nov 28 '18 at 21:36
  • @KickButtowski I don't understand what you mean `go around it`. what is your config and expectations? – Thanh Nov 29 '18 at 04:05
  • I meant how to agree database with the timezone. please take a look at https://stackoverflow.com/questions/53604767/activerecord-is-not-aware-of-timezones?noredirect=1#comment94072941_53604767 – Kick Buttowski Dec 04 '18 at 04:30