How to set the INDIA time zone in rails 3

I'm better on the rails

how to set india timezone in rails 3?

where to indicate this?

Please, help.

+6
source share
2 answers

In config/application.rb add this

 config.time_zone = 'Kolkata' 

That should work.

You can confirm this later by doing the following in the rails console

 >> Time.zone #output (GMT+05:30) Kolkata 
+13
source

You can simply run "rake time: zones: all" in your shell, you will find all the timestamps displayed for use in Rails. From the above, you can easily find the INDIAN time zone, as shown below.

 * UTC +05:30 * Chennai Kolkata Mumbai New Delhi 

Put any of the above names in config/application.rb as follows:

 config.time_zone = 'Chennai' 

Just restart the server and you will find the updated time zone.

Thanks.

+6
source

Source: https://habr.com/ru/post/921481/


All Articles