I am fresher in rails,
how to set the time zone of INDIA in rails 3 ?
where to specify this?
Please help.
Ruby | Time zone() functionTime#zone() : zone() is a Time class method which returns the name of the time zone used for time like “UTC”, “GMT”.
In your config/application.rb
, add this
config.time_zone = 'Kolkata'
That should work.
Later you can confirm this by running the following in rails console
>> Time.zone
#output
(GMT+05:30) Kolkata
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With