Steps to reproduce:
1) Set your computer to a time and time zone where daylight-savings time are in effect. (Pacific Time, April 3, 2006 is a good time zone and time.)
2) Use TimeZone to get UTC offset
Expected results:
UTC offset is accurate for the time zone and time. Adjusted times are accurate for daylight-savings time.
Actual results:
UTC offset is only returns the non-daylight-savings time. Adjusted times are one hour off during daylight-savings time.
Here it is on the console:
>> Time.now.gmtoff
=> -25200
>> TimeZone.all.select { |t| t.name =~ /pacific/i }.map { |t| t.utc_offset }
=> [-28800]
>> TimeZone.all.select { |t| t.name =~ /pacific/i }.map { |t| t.name }
=> ["Pacific Time (US & Canada)"]
>> pt = TimeZone[_.first]
=> #<TimeZone:0x24eaa54 @utc_offset=-28800, @name="Pacific Time (US & Canada)">
>> Time.now
=> Mon Apr 03 01:09:18 PDT 2006
>> pt.adjust Time.now.gmtime
=> Mon Apr 03 00:09:24 UTC 2006