Is it possible to change default TimeZone in MongoDB using Rails 3?

前端 未结 2 988
无人共我
无人共我 2021-01-14 10:44

I have such trouble: when I\'m creating object and setting some datetime It is saving database in UTC TimeZone. Here is example:

//showing full list of objec         


        
2条回答
  •  轮回少年
    2021-01-14 11:18

    You can change the timezone of your application so that ruby's date object will auto configure the dates. MongoDB will always store time in UTC.

    MongoDB has no internal knowledge of timezones.

提交回复
热议问题