Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Rails config.time_zone to GMT +6?

When I pop open the rails application.config to set the timezone, I come across an example like this:

config.time_zone = 'Central Time (US & Canada)'

But I would like to try to set my time to something like GMT+6 unfortunately if I try to use that value I get a Invalid Time Zone error. So what name do I have to use to get GMT+6? I tried looking up the name on TimeandDate.com but that gave me the same error when I tried to put Kyrgyzstan Time

Where exactly is the list of time zones rails uses? Or do I have to use some other format like +0600 (which doesn't work by the way)

Thanks,

like image 274
Eric Avatar asked Dec 20 '22 12:12

Eric


1 Answers

If you run

rake time:zones:all OFFSET=+6

you will get a list of cities

* UTC +06:00 *
Almaty
Astana
Dhaka
Ekaterinburg

of which the names can be directly used, like

config.time_zone = 'Astana'
like image 133
Danny Avatar answered Jan 02 '23 00:01

Danny