[TZInfo-users] Using TZ to convert to EST

John Sheahan johnsheahan at charter.net
Mon Nov 12 20:29:40 EST 2007


Hi TZ users,

I just installed the tz gem and am trying to follow the example on http://tzinfo.rubyforge.org/doc/

I put the following in my controller at the top (not under any def)


    require 'tzinfo'

I then put the following under one of my definitions in my controller for the page I want the time to be displayed on:
    
      tz = TZInfo::Timezone.get('America/New_York')
     @local = tz.utc_to_local(Time.utc(2005,8,29,15,35,0))

I was trying to call this in my view with this statement which doesn't work:


    <td><%=@ local %></td>

I'm obviously calling this incorrectly, would you have any suggestions?
The error I'm getting in my log is:

TZInfo::InvalidTimezoneIdentifier (Invalid identifier):
    /usr/local/ruby/lib/ruby/gems/1.8/gems/tzinfo-0.3.5/lib/tzinfo/timezone.rb:81:in `get'
    /app/controllers/buy_controller.rb:28:in `indexadmin'

thanks
jackster
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/tzinfo-users/attachments/20071112/3ac665c2/attachment.html 


More information about the TZInfo-users mailing list