Converting Time to IST in Rails
OK, in this blog I am going to say how to convert your time to Indian Standard Time. Most Rails servers return their time in UTC, but if you are developing application for a Indian firm they would like it in IST.
Lets say in your application you print your time on the webpage like this:
This will surely give the time in UTC like 2012-01-13 15:19:43 UTC, but you need it in IST, to do so add this method in our application helper
In view just modify the code as follows
And thats it, you will get time like 2012-01-13 20:49:43 +0530