私はそのような問題を抱えています:オブジェクトを作成して日時を設定しているときそれはUTCTimeZoneでデータベースを保存しています。次に例を示します。
//showing full list of object properties
Grant _id: 5108ee29e6b564611400000, start_date: 2013-01-30 09:56:27 UTC
//then showing a.start_date
Wed, 30 Jan 2013 13:56:27 +0400
データベースがUTCを使用することを禁止しようとしました。これがmongoid.ymlです:
development:
options:
raise_not_found_error: false
sessions:
default:
use_activesupport_time_zone: true
use_utc: false
database: test_mongoid_production
hosts:
- localhost:27017
options:
consistency: :strong
およびapplication.rb内:
config.time_zone = 'Moscow'
しかし、それは機能しません。
誰かがこの問題を手伝ってくれる?