我有这样的麻烦:当我创建对象并设置一些日期时间时,它将数据库保存在 UTC 时区中。这是示例:
//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'
但它不起作用。
有人可以帮忙解决这个问题吗?