0xSina
0xSina

Reputation: 21553

ActiveRecord timezone without rails

I am using ActiveRecord in a non-rails project. In rails I can do:

 config.time_zone = 'Eastern Time (US & Canada)'
 config.active_record.default_timezone = 'Eastern Time (US & Canada)'

But if I am not using rails, how can I set the timezone?

Upvotes: 5

Views: 1714

Answers (2)

ohho
ohho

Reputation: 51941

ActiveRecord::Base.default_timezone = :local

also works for me.

Upvotes: 4

Mike Li
Mike Li

Reputation: 3406

ActiveRecord::Base.default_timezone = 'Eastern Time (US & Canada)'

Upvotes: 5

Related Questions