简体   繁体   中英

how to set time zone for mongoid

I am using mongoid for my rails app.

I want to set time zone for mongoid.

I tried with this in application.rb

config.mongoid.time_zone  = 'Kolkata'

but no luck. I also tried with this

use_utc: false
use_activesupport_time_zone: true

still it uses default time zone UTC.

rails 3.0.10

mongoid 2.2.4

please help.

thanks in advance.

in application.rb like this

config.time_zone = 'Kolkata'

and in mongoid.yml

use_activesupport_time_zone: true

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM