How to convert time from one timezone to another

Hello,

 How to convert utc time to a time in a particular time zone. As I

need to display local time of timezone(-05:00).

Thank you,
Praveen

On Friday, April 4, 2014 2:37:28 AM UTC-4, Ruby-Forum.com User wrote:


Posted via http://www.ruby-forum.com/.

use the ruby method local time. in my example, i have an object post
with
an attribute created_at that is a date/time. You display this in local
time with formatting as follows:

<%= post.created_at.localtime.strftime("%-m/%-d/%Y at %-I:%M %p") %>

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs