Here is the following from my console:
=> Mon Sep 22 11:33:34 +0200 2008
=> #<TimeZone:0x11aea90 @tzinfo=nil, @utc_offset=7200, @name="Athens">
=> Mon, 22 Sep 2008 12:34:22 EEST +03:00
(I am in Spain - CET - and running on OS X with the correct timezone)
The Time.now correctly gives me the time, and the correct UTC offset
of 2 hours. It is the summer, so we are 2 hours ahead of UTC. We are
still one hour ahead of London, but London itself is an hour ahead as
they too switch to a summer time (BST).
ruby tells me that my utc_offset is 7200 - which is correct. But...
when I pull out the timezone it gives me the wrong one. Athens is 3
hours ahead of UTC, not 2 (at this time of year). So, when I convert a
time using the timezone it gives me it is an hour out!
I had hoped that time zone woes were behind me after switching to RoR
from Java. But it still seems to be a problem.
How can I get the correct Time Zone?
There is a bug tracked (http://dev.rubyonrails.org/ticket/4551) but it
seems to be set to closed... but it definitely isn't fixed!
Right now I am doing this:
offset = Time.now.dst? ? 60 : 0
Anyone have any better solutions?