Is it possible to get timezone abbreviations using the TimeZone or TzinfoTimezone classes? Even after converting UTC to localtime it still reports the timezone abbreviation as UTC. Example:>> @tz = TzinfoTimezone.us_zones[2]=> #<TzinfoTimezone:0x30868a0 @utc_offset=-28800, @name="Pacific Time (US & Canada)">>> @tz.now=> Wed Jan 24 12:36:56 UTC 2007>> @tz.now.strftime("%Z")=> "UTC" It seems to me that the timezone abbreviation (%Z) should be "PST" in this case. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sorry about the reply-to-myself, but I found the answer. The tzinfo gem has its own strftime method which returns the correct local timezone abbreviation for %Z. TzinfoTimezone plugin does not wrap this method. It was very simple to add to the plugin: def strftime(string, time=Time.now.utc) tzinfo.strftime(string, time) end I''m sending this to the author as well. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---