Hello!

Is there an easy way to get a time in a particular time zone without
calling Time.zone = some_zone ?

I store events in UTC in the DB, and I also store a string
representation of the time zone as an attribute on the event.

What works is to do:

Time.zone = event.time_zone
start_time = event.start.in_time_zone
# and now I have the start time in the appropriate time zone

The problem, however, is that Time.zone = event.time_zone sets it
across the whole application, as best as I can tell. And I don't want
that!!

I could grab the Time.zone value, change it as above, then change it
back, but that's so ugly. What would be wonderful is if there was
something like:

start_time = event.start.in_time_zone(event.time_zone)

*sigh*

Anything like that? Any advice? This isn't an issue with a user's
local time zone, but rather just trying to show a PST time as 8am PST
and an EST time as 11am EST even if both are stored as 15:00:00 (in
UTC)

Thoughts?

-Danimal
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to