E
E
eldar_web2015-09-07 20:22:23
Ruby on Rails
eldar_web, 2015-09-07 20:22:23

In Rails, when adding an entry, created_at creates a time not in the current time zone, how to solve?

Added an entry, creates created_at = Mon, 07 Sep 2015 17:01:24 +0000
And the current time is through Time.now: 2015-09-07 20:01:24 +0300
Why are they different, or rather created_at is not correct ???
How to solve???

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
The Whiz, 2015-09-07
@eldar_web

We go to config/environments/development.rb
We putconfig.time_zone = "Moscow"

T
TyzhSysAdmin, 2015-09-07
@POS_troi

config/application.rb
if I'm not mistaken

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question