Hi all,

I have a big deal with timezones: is it possible to set a user's
timezone from it's offset from UTC?
I mean, I don't want to ask the user in which timezone he is, so I get
this offset from a Javascript call
and set Time.zone from this.

It worked until I noticed this problem:
In Paris, we are in UTC+2 in the summer, so I have a 7200 seconds
offset.
ActiveSupport::TimeZone will not return the Paris timezone, but the
first one it can get with a 7200 offset,
which is Athen. The trick is that Athen is currently (September) UTC
+3, so I'll getting fooled by TimeZone.

I saw this in the Rails API (http://api.rubyonrails.org/classes/
ActiveSupport/TimeZone.html#M001511)
+TimeZone::new(name, utc_offset, tzinfo = nil) + but can't use it

What am I doing wrong/missing? (apart from not asking the user for his
timezone :p)

Thanks

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

Reply via email to